MotionSettings Class |
Namespace: DigitalRune.Physics.Settings
The MotionSettings type exposes the following members.
Name | Description | |
---|---|---|
MotionSettings |
Initializes a new instance of the MotionSettings class.
|
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
CcdEnabled |
Gets or sets a value indicating whether Continuous Collision Detection (CCD) is enabled.
| |
CcdFilter |
Gets or sets a predicate method that defines whether CCD is enabled between a pair of rigid
bodies.
| |
CcdVelocityThreshold |
Gets or sets the velocity threshold for Continuous Collision Detection (CCD).
| |
MaxAngularVelocity |
Gets or sets the maximal angular velocity.
| |
MaxLinearVelocity |
Gets or sets the maximal linear velocity.
| |
RemoveBodiesOutsideWorld |
Gets or sets a value indicating whether bodies that leave the simulation are automatically
removed.
|
Continuous Collision Detection (CCD): The purpose of CCD is to detect collisions of fast moving objects that would otherwise be missed. The opposite of CCD is Discrete Collision Detection which only checks for collision at one position for each frame. If the objects move, collisions between the old position and new position are not detected. Example: A bullet (e.g. a small sphere shape) is fired at a wall. In one frame the bullet is in front of the wall. In the next frame the bullet is behind the wall without touching it. If this happens Discrete Collision Detection does not report a collision. This problem is known as "tunneling". CCD is more expensive but detects all collisions. (CCD has some limitations, for example, some collisions that occur because of rotational movement can be missed. But such limitations are hardly noticeable).
Motion Clamping: If CCD is enabled, the Simulation uses a strategy called "Motion Clamping" to deal with fast moving objects: In each time step fast moving objects are only moved to their first time of impact, so that a collision is detected in the next time step. This is obviously not physically correct because the fast moving object moves a smaller distance than it should - but for fast moving objects, like bullets, it is more important to detect all collisions and it is usually not noticeable when the movement distance is clamped.
CCD Settings: CCD can be globally enabled or disabled with CcdEnabled. CCD is only performed for rigid bodies that have a velocity beyond CcdVelocityThreshold and if CcdEnabled is set. Further, a filter predicate method (CcdFilter) can be set. CCD is only used if no predicate method is set or if the predicate method returns for a pair of rigid bodies.