public record struct BodyDescriptionEverything needed to create a body, in one value.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A record struct with initialisers rather than a builder or a long constructor: a body has a dozen knobs, eleven of which are almost always their default, and new BodyDescription { Shape = box, Motion = BodyMotion.Dynamic } says exactly what is unusual about this one and nothing else.
The defaults are Jolt's, except Friction and Restitution, which are Jolt's too — 0.2 and 0 — and are called out because they are the two people reach for first and the two whose defaults are least guessable.
Fields and properties (18)
public ShapeId ShapeThe collision volume. Required.
public Vector3 PositionWhere the body starts.
public Quaternion RotationWhich way it starts.
public BodyMotion MotionHow it moves.
public BodyMotionQuality MotionQualityHow carefully its motion is swept.
public PhysicsLayer LayerWhich layer it is on, and so what it collides with.
public Vector3 LinearVelocityIts starting linear velocity, in metres a second.
public Vector3 AngularVelocityIts starting angular velocity, in radians a second about each axis.
public float MassIts mass in kilograms, or zero to take the shape's — density times volume.
public float GravityFactorHow much of the world's gravity applies. One is all of it; zero is none.
public float FrictionFriction, roughly 0 (ice) to 1 (rubber). Combined with the other body's.
public float RestitutionBounciness, 0 (clay) to 1 (perfectly elastic). Combined with the other body's.
public float LinearDampingHow quickly linear motion bleeds away, per second.
public float AngularDampingHow quickly angular motion bleeds away, per second.
public BodyDegreesOfFreedom DegreesOfFreedomWhich axes it may move and turn about.
public bool IsSensorWhether the body reports overlaps instead of resolving them — a trigger volume.
public bool AllowSleepingWhether the body may fall asleep when it stops moving.
public ulong UserDataWhatever the owner wants to associate with the body. The ECS bridge puts an entity here.
Methods (5)
public static BodyDescription Create()A description with the engine's defaults, which is everything but a shape.
public static BodyDescription Dynamic(ShapeId shape, Vector3 position)A dynamic body with a shape, at a place.
public static BodyDescription Static(ShapeId shape, Vector3 position)A static body with a shape, at a place.
public static BodyDescription Kinematic(ShapeId shape, Vector3 position)A kinematic body with a shape, at a place.
public static BodyDescription Trigger(ShapeId shape, Vector3 position)A sensor — a volume that reports what enters it and stops nothing.
Used by (14)
- CharacterControllerTestsVixen.Physics.Tests
- HeightFieldShapeTestsVixen.Physics.Tests
- JoltMathTestsVixen.Physics.Tests
- LagCompensationTestsVixen.Net.Physics.Tests
- PhysicsConstraintTestsVixen.Physics.Tests
- PhysicsDeterminismTestsVixen.Physics.Tests
- PhysicsLayerTestsVixen.Physics.Tests
- PhysicsOcclusionTestsVixen.Audio.Physics.Tests
- PhysicsQueryTestsVixen.Physics.Tests
- PhysicsSceneVixen.Physics
- PhysicsShapeTestsVixen.Physics.Tests
- PhysicsWorldVixen.Physics
- PhysicsWorldTestsVixen.Physics.Tests
- Vixen_Physics_Bodies_BodyDescriptionSerializerVixen.Physics