Click or drag to resize
DigitalRuneContactConstraint Class
Defines a constraint at a rigid body contact that models non-penetration, dry friction and bounciness.
Inheritance Hierarchy
SystemObject
  DigitalRune.Physics.ConstraintsContactConstraint

Namespace: DigitalRune.Physics.Constraints
Assembly: DigitalRune.Physics (in DigitalRune.Physics.dll) Version: 1.10.0.0 (1.10.0.14427)
Syntax
public sealed class ContactConstraint : IConstraint

The ContactConstraint type exposes the following members.

Methods
  NameDescription
Public methodApplyImpulse
Called by the simulation to apply an impulse that satisfies the constraint.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(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.)
Public methodSetup
Called by the simulation to prepare this constraint for constraint solving for a new time step.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyBodyA
Gets the first body.
Public propertyBodyB
Gets the second body.
Public propertyContact
Gets the contact.
Public propertyErrorReduction
Gets or sets the error reduction parameter.
Public propertyLinearConstraintImpulse
Gets or sets the linear constraint impulse that was applied.
Public propertySimulation
Gets the simulation to which this constraint belongs.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate propertyIConstraintAngularConstraintImpulse
Gets or sets the angular constraint impulse that was applied.
Explicit interface implementationPrivate propertyIConstraintCollisionEnabled
Gets a value indicating whether collisions between BodyA and BodyB are disabled.
Explicit interface implementationPrivate propertyIConstraintEnabled
Gets a value indicating whether this constraint is enabled.
Top
Remarks

The simulation automatically creates ContactConstraints for all contacts that are found by the collision detection and where collision response is enabled.

The property Contact.UserData is used by the simulation to store references to the ContactConstraint instances. Therefore, the UserData property of contacts between rigid bodies must not be changed. In other words, the relationship between contacts and contact constraints is:

myContactConstraint.Contact == myContact
myContact.UserData == myContactConstraint

See Also