|  | TwistSwingLimit Class | 
 Inheritance Hierarchy
Inheritance HierarchyNamespace: DigitalRune.Physics.Constraints
 Syntax
SyntaxThe TwistSwingLimit type exposes the following members.
 Constructors
Constructors| Name | Description | |
|---|---|---|
|  | TwistSwingLimit | Initializes a new instance of the TwistSwingLimit class | 
 Methods
Methods| Name | Description | |
|---|---|---|
|  | ApplyImpulse | 
            Called by the simulation to apply an impulse that satisfies the constraint.
            (Inherited from Constraint.) | 
|  | 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.) | 
|  | GetPointOnCone | 
            Gets a point on the swing limit cone (for debug visualization).
             | 
|  | GetType | Gets the Type of the current instance.(Inherited from Object.) | 
|  | MemberwiseClone | Creates a shallow copy of the current Object.(Inherited from Object.) | 
|  | OnAddToSimulation | 
            Called when this constraint is added to a simulation.
            (Inherited from Constraint.) | 
|  | OnApplyImpulse | 
            Called when the constraint impulse should be applied.
            (Overrides ConstraintOnApplyImpulse.) | 
|  | OnChanged | 
            Called when properties of this constraint were changed.
            (Overrides ConstraintOnChanged.) | 
|  | OnRemoveFromSimulation | 
            Called when this constraint is removed from a simulation.
            (Inherited from Constraint.) | 
|  | OnSetup | 
            Called when constraint should be set-up for a new time step.
            (Overrides ConstraintOnSetup.) | 
|  | Setup | 
            Called by the simulation to prepare this constraint for constraint solving for a new time
            step.
            (Inherited from Constraint.) | 
|  | ToString | Returns a string that represents the current object.(Inherited from Object.) | 
 Properties
Properties| Name | Description | |
|---|---|---|
|  | AnchorOrientationALocal | |
|  | AnchorOrientationBLocal | |
|  | AngularConstraintImpulse | 
            Gets or sets the angular constraint impulse that was applied.
            (Overrides ConstraintAngularConstraintImpulse.) | 
|  | BodyA | 
            Gets or sets the first body.
            (Inherited from Constraint.) | 
|  | BodyB | 
            Gets or sets the second body.
            (Inherited from Constraint.) | 
|  | CollisionEnabled | (Inherited from Constraint.) | 
|  | Enabled | 
            Gets or sets a value indicating whether this constraint is enabled.
            (Inherited from Constraint.) | 
|  | ErrorReduction | 
            Gets or sets the error reduction parameter.
             | 
|  | LinearConstraintImpulse | 
            Gets or sets the linear constraint impulse that was applied. 
            (Overrides ConstraintLinearConstraintImpulse.) | 
|  | MaxForce | 
            Gets or sets the maximal forces that are applied by this constraint.
             | 
|  | Maximum | 
            Gets or sets the maximum movement limit on the twist and swing axes.
             | 
|  | Minimum | 
            Gets or sets the minimum movement limit on the twist and swing axes.
             | 
|  | Restitution | 
            Gets or sets the coefficient of restitution for limits.
             | 
|  | Simulation | 
            Gets the simulation to which this constraint belongs.
            (Inherited from Constraint.) | 
|  | Softness | 
            Gets or sets the softness.
             | 
 Remarks
RemarksThis limit is often used to limit the rotation of ragdoll joints. AnchorOrientationALocal defines a coordinate frame fixed on the first body. AnchorOrientationBLocal defines a coordinate frame fixed on the second body. Twist is defined as the rotation of the x-axis (x is the twist axis). Swing is defined as the deviation of the x-axes. The y- and the z-axes fixed on the first body are the swing axes. The twist and swing values are angles in the range [-π, π]. Using the properties Minimum and Maximum the twist and swing angles can be limited. Limiting the swing angles creates a limit cone. Different minimum and maximum swing limits can be chosen for the swing axes. This can be used to create a deformed limit cone.
This constraint should not be used if the swing on a swing axis is locked (minimum and maximum is set to 0). In this case a different constraint type should be used (e.g. a HingeJoint). Using very non-uniform swing limits is also not recommended. The swing limits appear "smoother" if the cone is symmetric.
 See Also
See Also