Class BepuPhysicsOptions
The options of a primitive entity with Bepu physics, 2D or 3D: the entity options plus the body's mode, component, mass and interpolation.
public class BepuPhysicsOptions : PrimitiveEntityOptions
- Inheritance
-
BepuPhysicsOptions
- Inherited Members
Remarks
With Component left null, Body decides what is attached: a BodyComponent (a Body2DComponent for a flat shape), the same body kinematic, or a StaticComponent; None attaches nothing. The component gets a CompoundCollider with the shape that fits the primitive, and a 2D shape's collider is as deep as the shape says.
A supplied Component wins over the mode and is used as it is, kinematic or not, interpolated or not. Give it an empty CompoundCollider to have the fitted shape added, or a compound that already holds shapes to keep them: the fitted shape goes into an empty compound only. A supplied component with None is refused, since the two contradict each other.
Options without a component can serve any number of entities, each getting a fresh component. Options with a supplied component serve one entity: a component belongs to one entity, and the engine refuses it on a second.
Properties
Component
Gets or sets the Bepu collidable component attached to the entity, or null to have one made from Body.
public CollidableComponent? Component { get; set; }
Property Value
Interpolation
Whether a body the options create is interpolated between physics steps, so it moves smoothly at any frame rate above the physics rate. On by default; a supplied Component keeps its own setting.
public bool Interpolation { get; set; }
Property Value
Remarks
The engine's default is no interpolation, which stutters whenever a frame lands between two steps. Turn it off for a body whose transform you read right after the step, as a sensor or a test does.
Mass
Gets or sets the mass of the fitted collider shape, in kilograms, or null for Bepu's default of 1.
public float? Mass { get; set; }
Property Value
Remarks
Bepu keeps mass on the collider shape, so this is applied to the shape fitted to the primitive. A compound that already holds your own shapes keeps their masses. A static collider has no mass; a value given with Static is ignored with a line in the log.