Struct BodyDescription
- Namespace
- BepuPhysics
- Assembly
- BepuPhysics.dll
Describes a body's state.
public struct BodyDescription
- Inherited Members
Fields
Activity
Sleeping settings for the body.
public BodyActivityDescription Activity
Field Value
Collidable
Shape and collision detection settings for the body.
public CollidableDescription Collidable
Field Value
LocalInertia
Mass and inertia tensor of the body.
public BodyInertia LocalInertia
Field Value
Pose
Position and orientation of the body.
public RigidPose Pose
Field Value
Velocity
Linear and angular velocity of the body.
public BodyVelocity Velocity
Field Value
Methods
CreateConvexDynamic<TConvexShape>(RigidPose, BodyVelocity, float, Shapes, in TConvexShape)
Creates a dynamic body description with collidable, inertia, and activity descriptions generated from a convex shape. Adds the shape to the given shape set.
public static BodyDescription CreateConvexDynamic<TConvexShape>(RigidPose pose, BodyVelocity velocity, float mass, Shapes shapes, in TConvexShape shape) where TConvexShape : unmanaged, IConvexShape
Parameters
pose
RigidPosePose of the body.
velocity
BodyVelocityInitial velocity of the body.
mass
floatMass of the body. The inertia tensor will be calculated based on this mass and the shape.
shapes
ShapesShape collection to add the shape to.
shape
TConvexShapeShape to add to the shape set and to create the body from.
Returns
- BodyDescription
Constructed description for the body.
Type Parameters
TConvexShape
Type of the shape to create a body for.
CreateConvexDynamic<TConvexShape>(RigidPose, float, Shapes, in TConvexShape)
Creates a dynamic body description with zero initial velocity and collidable, inertia, and activity descriptions generated from a convex shape. Adds the shape to the given shape set.
public static BodyDescription CreateConvexDynamic<TConvexShape>(RigidPose pose, float mass, Shapes shapes, in TConvexShape shape) where TConvexShape : unmanaged, IConvexShape
Parameters
pose
RigidPosePose of the body.
mass
floatMass of the body. The inertia tensor will be calculated based on this mass and the shape.
shapes
ShapesShape collection to add the shape to.
shape
TConvexShapeShape to add to the shape set and to create the body from.
Returns
- BodyDescription
Constructed description for the body.
Type Parameters
TConvexShape
Type of the shape to create a body for.
CreateConvexKinematic<TConvexShape>(RigidPose, BodyVelocity, Shapes, in TConvexShape)
Creates a kinematic body description with collidable and activity descriptions generated from a convex shape. Adds the shape to the given shape set.
public static BodyDescription CreateConvexKinematic<TConvexShape>(RigidPose pose, BodyVelocity velocity, Shapes shapes, in TConvexShape shape) where TConvexShape : unmanaged, IConvexShape
Parameters
pose
RigidPosePose of the body.
velocity
BodyVelocityInitial velocity of the body.
shapes
ShapesShape collection to add the shape to.
shape
TConvexShapeShape to add to the shape set and to create the body from.
Returns
- BodyDescription
Constructed description for the body.
Type Parameters
TConvexShape
Type of the shape to create a body for.
CreateConvexKinematic<TConvexShape>(RigidPose, Shapes, TConvexShape)
Creates a kinematic body description with zero initial velocity and collidable and activity descriptions generated from a convex shape. Adds the shape to the given shape set.
public static BodyDescription CreateConvexKinematic<TConvexShape>(RigidPose pose, Shapes shapes, TConvexShape shape) where TConvexShape : unmanaged, IConvexShape
Parameters
pose
RigidPosePose of the body.
shapes
ShapesShape collection to add the shape to.
shape
TConvexShapeShape to add to the shape set and to create the body from.
Returns
- BodyDescription
Constructed description for the body.
Type Parameters
TConvexShape
Type of the shape to create a body for.
CreateDynamic(RigidPose, BodyInertia, CollidableDescription, BodyActivityDescription)
Creates a dynamic body description with zero initial velocity.
public static BodyDescription CreateDynamic(RigidPose pose, BodyInertia inertia, CollidableDescription collidable, BodyActivityDescription activity)
Parameters
pose
RigidPosePose of the body.
inertia
BodyInertiaLocal inertia of the body.
collidable
CollidableDescriptionCollidable to associate with the body.
activity
BodyActivityDescriptionActivity settings for the body.
Returns
- BodyDescription
Constructed description for the body.
CreateDynamic(RigidPose, BodyVelocity, BodyInertia, CollidableDescription, BodyActivityDescription)
Creates a dynamic body description.
public static BodyDescription CreateDynamic(RigidPose pose, BodyVelocity velocity, BodyInertia inertia, CollidableDescription collidable, BodyActivityDescription activity)
Parameters
pose
RigidPosePose of the body.
velocity
BodyVelocityInitial velocity of the body.
inertia
BodyInertiaLocal inertia of the body.
collidable
CollidableDescriptionCollidable to associate with the body.
activity
BodyActivityDescriptionActivity settings for the body.
Returns
- BodyDescription
Constructed description for the body.
CreateKinematic(RigidPose, BodyVelocity, CollidableDescription, BodyActivityDescription)
Creates a kinematic body description.
public static BodyDescription CreateKinematic(RigidPose pose, BodyVelocity velocity, CollidableDescription collidable, BodyActivityDescription activity)
Parameters
pose
RigidPosePose of the body.
velocity
BodyVelocityInitial velocity of the body.
collidable
CollidableDescriptionCollidable to associate with the body.
activity
BodyActivityDescriptionActivity settings for the body.
Returns
- BodyDescription
Constructed description for the body.
CreateKinematic(RigidPose, CollidableDescription, BodyActivityDescription)
Creates a kinematic body description with zero initial velocity.
public static BodyDescription CreateKinematic(RigidPose pose, CollidableDescription collidable, BodyActivityDescription activity)
Parameters
pose
RigidPosePose of the body.
collidable
CollidableDescriptionCollidable to associate with the body.
activity
BodyActivityDescriptionActivity settings for the body.
Returns
- BodyDescription
Constructed description for the body.
GetDefaultActivity<TShape>(in TShape)
Computes a decent default activity description for a shape.
public static BodyActivityDescription GetDefaultActivity<TShape>(in TShape shape) where TShape : struct, IConvexShape
Parameters
shape
TShapeShape to create an activity description for.
Returns
- BodyActivityDescription
Default activity description for the given shape.
Type Parameters
TShape
Type of the shape to create an activity description for.
GetDefaultSpeculativeMargin<TShape>(in TShape)
Computes a decent default speculative margin for a shape based on its minimum and maximum radii.
public static float GetDefaultSpeculativeMargin<TShape>(in TShape shape) where TShape : struct, IConvexShape
Parameters
shape
TShapeShape to compute a speculative margin for.
Returns
- float
Speculative margin for the given shape.
Type Parameters
TShape
Type of the shape to compute a speculative margin for.