Click or drag to resize
DigitalRuneConstraintCollisionEnabled Property
Gets or sets a value indicating whether collisions between BodyA and BodyB are disabled.

Namespace: DigitalRune.Physics.Constraints
Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 1.10.0.0 (1.10.0.14427)
Syntax
public bool CollisionEnabled { get; set; }

Property Value

Type: Boolean
if collisions are enabled; otherwise, . The default is (= collisions are enabled).

Implements

IConstraintCollisionEnabled
Remarks

This property can be set to to disable collision detection between the constraint bodies. Disabling collisions improves performance and is often necessary, for example, for two connected limbs in a ragdoll that are always penetrating each other.

This flag can only be used if the collision detection of the Simulation uses a collision filter that implements ICollisionFilter. This is the case with a new Simulation instance: By default, Simulation.CollisionDomain.CollisionDetection.CollisionFilter is set to a CollisionFilter instance. If the CollisionFilter property is set to a custom filter that does not implement ICollisionFilter, then this property does nothing.

If you change the collision filtering manually by explicitly enabling/disabling collisions between rigid body pairs in the collision filter, then CollisionEnabled should not be used (leave the default value of ). Otherwise, the constraint might override your filter settings. To avoid conflicts, either define the collision filtering between body pairs manually using the collision filter or use the CollisionEnabled property to disable collisions.

See Also