Table of Contents

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

BodyActivityDescription

Collidable

Shape and collision detection settings for the body.

public CollidableDescription Collidable

Field Value

CollidableDescription

LocalInertia

Mass and inertia tensor of the body.

public BodyInertia LocalInertia

Field Value

BodyInertia

Pose

Position and orientation of the body.

public RigidPose Pose

Field Value

RigidPose

Velocity

Linear and angular velocity of the body.

public BodyVelocity Velocity

Field Value

BodyVelocity

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 RigidPose

Pose of the body.

velocity BodyVelocity

Initial velocity of the body.

mass float

Mass of the body. The inertia tensor will be calculated based on this mass and the shape.

shapes Shapes

Shape collection to add the shape to.

shape TConvexShape

Shape 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 RigidPose

Pose of the body.

mass float

Mass of the body. The inertia tensor will be calculated based on this mass and the shape.

shapes Shapes

Shape collection to add the shape to.

shape TConvexShape

Shape 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 RigidPose

Pose of the body.

velocity BodyVelocity

Initial velocity of the body.

shapes Shapes

Shape collection to add the shape to.

shape TConvexShape

Shape 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 RigidPose

Pose of the body.

shapes Shapes

Shape collection to add the shape to.

shape TConvexShape

Shape 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 RigidPose

Pose of the body.

inertia BodyInertia

Local inertia of the body.

collidable CollidableDescription

Collidable to associate with the body.

activity BodyActivityDescription

Activity 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 RigidPose

Pose of the body.

velocity BodyVelocity

Initial velocity of the body.

inertia BodyInertia

Local inertia of the body.

collidable CollidableDescription

Collidable to associate with the body.

activity BodyActivityDescription

Activity 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 RigidPose

Pose of the body.

velocity BodyVelocity

Initial velocity of the body.

collidable CollidableDescription

Collidable to associate with the body.

activity BodyActivityDescription

Activity 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 RigidPose

Pose of the body.

collidable CollidableDescription

Collidable to associate with the body.

activity BodyActivityDescription

Activity 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 TShape

Shape 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 TShape

Shape 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.