API ReferenceSandbox
ModelBuilderclass
Provides ability to generate `Sandbox.Model`s at runtime. A static instance of this class is available at `Sandbox.Model.Builder`
object→ModelBuilder
Constructors1
Showing 1 constructors
public ModelBuilder()
No results match this filter.
Methods34
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.
| Parameter | Type | Description |
|---|---|---|
| name | string | The name of the animation. |
| frameRate | float | The frames per second of the animation. |
public Sandbox.ModelBuilder AddAttachment(string name, Vector3 position, Rotation rotation, string parentName = null)
Add an attachment to the skeleton.
| Parameter | Type | Description |
|---|---|---|
| name | string | — |
| position | Vector3 | — |
| rotation | Rotation | — |
| parentName = null | string | — |
public Sandbox.BallJointBuilder AddBallJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
| Parameter | Type | Description |
|---|---|---|
| body1 | int | — |
| body2 | int | — |
| frame1 = null | Nullable<Transform> | — |
| frame2 = null | Nullable<Transform> | — |
| collision = False | bool | — |
public Sandbox.PhysicsBodyBuilder AddBody(float mass = 0, Sandbox.Surface surface = null, string boneName = null)
Adds a new physics body to this object.
| Parameter | Type | Description |
|---|---|---|
| mass = 0 | float | The mass of the body. Default is `0`. |
| surface = null | Surface | The surface properties to apply. Default is `default`. |
| boneName = null | string | Optional name of the bone this body is attached to. Leave empty for non-skeletal bodies. |
public void AddBones(Sandbox.ModelBuilder.Bone[] bones)
Add multiple bones to the skeleton.
| Parameter | Type | Description |
|---|---|---|
| bones | Bone[] | — |
Returns:
void—public Sandbox.ModelBuilder AddCollisionBox(Vector3 extents, System.Nullable`1<Vector3> center = null, System.Nullable`1<Rotation> rotation = null)
| Parameter | Type | Description |
|---|---|---|
| extents | Vector3 | — |
| center = null | Nullable<Vector3> | — |
| rotation = null | Nullable<Rotation> | — |
public Sandbox.ModelBuilder AddCollisionCapsule(Vector3 center0, Vector3 center1, float radius)
Add capsule collision shape.
| Parameter | Type | Description |
|---|---|---|
| center0 | Vector3 | — |
| center1 | Vector3 | — |
| radius | float | — |
public Sandbox.ModelBuilder AddCollisionSphere(float radius, Vector3 center = null)
Add sphere collision shape.
| Parameter | Type | Description |
|---|---|---|
| radius | float | — |
| center = null | Vector3 | — |
public Sandbox.FixedJointBuilder AddFixedJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
| Parameter | Type | Description |
|---|---|---|
| body1 | int | — |
| body2 | int | — |
| frame1 = null | Nullable<Transform> | — |
| frame2 = null | Nullable<Transform> | — |
| collision = False | bool | — |
public Sandbox.HingeJointBuilder AddHingeJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
| Parameter | Type | Description |
|---|---|---|
| body1 | int | — |
| body2 | int | — |
| frame1 = null | Nullable<Transform> | — |
| frame2 = null | Nullable<Transform> | — |
| collision = False | bool | — |
public Sandbox.MaterialGroupBuilder AddMaterialGroup(string name)
Add a named material group builder.
| Parameter | Type | Description |
|---|---|---|
| name | string | — |
public Sandbox.SliderJointBuilder AddSliderJoint(int body1, int body2, System.Nullable`1<Transform> frame1 = null, System.Nullable`1<Transform> frame2 = null, bool collision = False)
| Parameter | Type | Description |
|---|---|---|
| body1 | int | — |
| body2 | int | — |
| frame1 = null | Nullable<Transform> | — |
| frame2 = null | Nullable<Transform> | — |
| collision = False | bool | — |
public Sandbox.ModelBuilder AddSurface(Sandbox.Surface surface)
| Parameter | Type | Description |
|---|---|---|
| surface | Surface | — |
public Sandbox.ModelBuilder WithLodDistance(int lod, float distance)
LOD switch distance increment for each Level of Detail (LOD) level. (Default is 50)
| Parameter | Type | Description |
|---|---|---|
| lod | int | — |
| distance | float | — |
public Sandbox.ModelBuilder WithMass(float mass)
Total mass of the physics body (Default is 1000)
| Parameter | Type | Description |
|---|---|---|
| mass | float | — |
public Sandbox.ModelBuilder WithName(string name)
Provide a name to identify the model by
| Parameter | Type | Description |
|---|---|---|
| name | string | Desired model name |
public Sandbox.ModelBuilder WithSurface(string name)
Surface property to use for collision
| Parameter | Type | Description |
|---|---|---|
| name | string | — |
No results match this filter.