Click or drag to resize
DigitalRuneMotionSettings Class
Defines motion-related simulation settings.
Inheritance Hierarchy
SystemObject
  DigitalRune.Physics.SettingsMotionSettings

Namespace: DigitalRune.Physics.Settings
Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 1.10.0.0 (1.10.0.14427)
Syntax
public class MotionSettings

The MotionSettings type exposes the following members.

Constructors
  NameDescription
Public methodMotionSettings
Initializes a new instance of the MotionSettings class.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyCcdEnabled
Gets or sets a value indicating whether Continuous Collision Detection (CCD) is enabled.
Public propertyCcdFilter
Gets or sets a predicate method that defines whether CCD is enabled between a pair of rigid bodies.
Public propertyCcdVelocityThreshold
Gets or sets the velocity threshold for Continuous Collision Detection (CCD).
Public propertyMaxAngularVelocity
Gets or sets the maximal angular velocity.
Public propertyMaxLinearVelocity
Gets or sets the maximal linear velocity.
Public propertyRemoveBodiesOutsideWorld
Gets or sets a value indicating whether bodies that leave the simulation are automatically removed.
Top
Remarks

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.

See Also