public sealed class Sandbox.ModelBuilder
Provides ability to generate `Sandbox.Model`s at runtime. A static instance of this class is available at `Sandbox.Model.Builder`
Constructors
Showing 1 constructors
public ModelBuilder()
No results match this filter.
Methods
Showing 34 methods
public Sandbox.AnimationBuilder AddAnimation(string name, float frameRate)
Adds an animation to this model and returns a builder to construct the animation.
Parameters
name: The name of the animation.frameRate: The frames per second of the animation.
Returns
An `Sandbox.AnimationBuilder` instance to construct the animation.
public Sandbox.ModelBuilder AddAttachment(string name, Vector3 position, Rotation rotation, string parentName = null)
Add an attachment to the skeleton.
Parameters
parentName: Default: null
public Sandbox.BallJointBuilder AddBallJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
Parameters
frame1: Default: nullframe2: Default: nullcollision: Default: False
public Sandbox.PhysicsBodyBuilder AddBody(float mass = 0, Sandbox.Surface surface = null, string boneName = null)
Adds a new physics body to this object.
Parameters
mass: The mass of the body. Default is `0`. Default: 0surface: The surface properties to apply. Default is `default`. Default: nullboneName: Optional name of the bone this body is attached to. Leave empty for non-skeletal bodies. Default: null
Returns
A new `Sandbox.PhysicsBodyBuilder` for configuring the body.
public void AddBones(Sandbox.ModelBuilder.Bone[] bones)
Add multiple bones to the skeleton.
public Sandbox.ModelBuilder AddCollisionBox(Vector3 extents, System.Nullable`1<Vector3> center = null, System.Nullable`1<Rotation> rotation = null)
Parameters
center: Default: nullrotation: Default: null
public Sandbox.ModelBuilder AddCollisionCapsule(Vector3 center0, Vector3 center1, float radius)
Add capsule collision shape.
public Sandbox.ModelBuilder AddCollisionSphere(float radius, Vector3 center = null)
Add sphere collision shape.
Parameters
center: Default: null
public Sandbox.FixedJointBuilder AddFixedJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
Parameters
frame1: Default: nullframe2: Default: nullcollision: Default: False
public Sandbox.HingeJointBuilder AddHingeJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
Parameters
frame1: Default: nullframe2: Default: nullcollision: Default: False
public Sandbox.MaterialGroupBuilder AddMaterialGroup(string name)
Add a named material group builder.
public Sandbox.SliderJointBuilder AddSliderJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
Parameters
frame1: Default: nullframe2: Default: nullcollision: Default: False
public Sandbox.ModelBuilder AddSurface(Sandbox.Surface surface)
public Sandbox.Model Create()
Finish creation of the model.
public Sandbox.ModelBuilder WithLodDistance(int lod, float distance)
LOD switch distance increment for each Level of Detail (LOD) level. (Default is 50)
public Sandbox.ModelBuilder WithMass(float mass)
Total mass of the physics body (Default is 1000)
public Sandbox.ModelBuilder WithName(string name)
Provide a name to identify the model by
Parameters
name: Desired model name
public Sandbox.ModelBuilder WithSurface(string name)
Surface property to use for collision
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.ModelBuilder |