API ReferenceSandbox
PhysicsBodyBuilderclass
Builds a physics body for a model or standalone physics resource.
object→PhysicsBodyBuilder
Constructors1
Showing 1 constructors
public PhysicsBodyBuilder()
No results match this filter.
Methods11
Showing 11 methods
public Sandbox.PhysicsBodyBuilder AddBox(Vector3 extents, System.Nullable`1<Transform> transform = null)
| Parameter | Type | Description |
|---|---|---|
| extents | Vector3 | — |
| transform = null | Nullable<Transform> | — |
public Sandbox.PhysicsBodyBuilder AddCapsule(Capsule capsule, System.Nullable`1<Transform> transform = null)
| Parameter | Type | Description |
|---|---|---|
| capsule | Capsule | — |
| transform = null | Nullable<Transform> | — |
public Sandbox.PhysicsBodyBuilder AddHull(System.Span`1<Vector3> points, System.Nullable`1<Transform> transform = null, System.Nullable`1<Sandbox.PhysicsBodyBuilder.HullSimplify> simplify = null)
| Parameter | Type | Description |
|---|---|---|
| points | Span<Vector3> | — |
| transform = null | Nullable<Transform> | — |
| simplify = null | Nullable<HullSimplify> | — |
public Sandbox.PhysicsBodyBuilder AddMesh(System.Span`1<Vector3> vertices, System.Span`1<uint> indices, System.Span`1<byte> materials)
| Parameter | Type | Description |
|---|---|---|
| vertices | Span<Vector3> | — |
| indices | Span<uint> | — |
| materials | Span<byte> | — |
public Sandbox.PhysicsBodyBuilder AddSphere(Sandbox.Sphere sphere, System.Nullable`1<Transform> transform = null)
| Parameter | Type | Description |
|---|---|---|
| sphere | Sphere | — |
| transform = null | Nullable<Transform> | — |
public Sandbox.PhysicsBodyBuilder SetBindPose(Transform bindPose)
| Parameter | Type | Description |
|---|---|---|
| bindPose | Transform | The bind pose transform. |
public Sandbox.PhysicsBodyBuilder SetBoneName(string boneName)
| Parameter | Type | Description |
|---|---|---|
| boneName | string | The attached bone name, or null to detach it. |
public Sandbox.PhysicsBodyBuilder SetDamping(float linear, float angular)
Sets linear and angular velocity damping per second.
| Parameter | Type | Description |
|---|---|---|
| linear | float | — |
| angular | float | — |
public Sandbox.PhysicsBodyBuilder SetInertiaScale(float scale)
| Parameter | Type | Description |
|---|---|---|
| scale | float | — |
public Sandbox.PhysicsBodyBuilder SetMass(float mass)
| Parameter | Type | Description |
|---|---|---|
| mass | float | The body mass in kilograms. |
public Sandbox.PhysicsBodyBuilder SetSurface(Sandbox.Surface surface)
| Parameter | Type | Description |
|---|---|---|
| surface | Surface | The surface properties applied to the body. |
No results match this filter.
Properties7
Showing 7 properties
public float Sandbox.PhysicsBodyBuilder.AngularDamping { get; set; }
Angular velocity damping per second.
Returns:
float—public Transform Sandbox.PhysicsBodyBuilder.BindPose { get; set; }
The bind pose transform used when attaching this body to a bone.
public string Sandbox.PhysicsBodyBuilder.BoneName { get; set; }
The name of the bone this body is attached to, or `null` if not attached.
Returns:
string—public float Sandbox.PhysicsBodyBuilder.InertiaScale { get; set; }
Multiplier for the calculated inertia tensor, independent of mass.
Returns:
float—public float Sandbox.PhysicsBodyBuilder.LinearDamping { get; set; }
Linear velocity damping per second.
Returns:
float—public float Sandbox.PhysicsBodyBuilder.Mass { get; set; }
The mass of the body in kilograms. Set to `0` to calculate automatically from its shapes and density.
Returns:
float—public Sandbox.Surface Sandbox.PhysicsBodyBuilder.Surface { get; set; }
The surface properties applied to this body.
No results match this filter.