Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 1.5.0.0 (1.5.0.9503)
Syntax
| C# |
|---|
public class RigidBody : IGeometricObject, ICloneable, INamedObject |
| Visual Basic |
|---|
Public Class RigidBody _ Implements IGeometricObject, ICloneable, INamedObject |
| Visual C++ |
|---|
public ref class RigidBody : IGeometricObject, ICloneable, INamedObject |
Remarks
A rigid body is a body that is simulated by rigid body dynamics. The body has a Shape that is constant for the simulation (although the shape can be exchanged by the user). No deformations are computed, therefore this body cannot model a soft body like cloth or fluids.
The body also has a mass properties defined in MassFrame and a Material that defines friction, bounciness and other material properties.
Center Of Mass: The body has a Pose that defines its position and orientation in world space. The origin of the local space of the body can be different from its center of mass. The body has a PoseCenterOfMass that defines the pose of the center of mass in world space. The center of mass is automatically computed from the shape of the rigid body when the body's MassFrame is created. To move the rigid body to a new pose the properties Pose or PoseCenterOfMass can be used; the two properties are synchronized automatically.
Collision Detection: The rigid body class implements IGeometricObject and it automatically creates a CollisionObject for the rigid body. This collision object is automatically added to the CollisionDomain of the simulation.
Cloning: The rigid body implements ICloneable and can be cloned using the Clone()()()() methods. Cloning creates a deep copy of the object. The content of the UserData property is cloned if it implements ICloneable; otherwise the UserData property is only copied. The property Material is copied and not cloned, so the clone will refer to the same Material instance. All other properties are properly cloned.
Sleeping: See also SleepingSettings. The rigid body automatically wakes up if important properties are changed - for example, if the Shape is changed, the body wakes up.