Collider Constraint. More...
#include <deColliderConstraint.h>
Classes | |
| struct | sDOF |
| Degree of freedom parameter. | |
Public Types | |
| enum | eLimits { elLinearX, elLinearY, elLinearZ, elAngularX, elAngularY, elAngularZ } |
Limits. More... | |
Public Member Functions | |
Constructors and Destructors | |
| deColliderConstraint () | |
| Creates a new collider constraint. | |
| virtual | ~deColliderConstraint () |
| Cleans up the collider constraint. | |
Management | |
| const decVector & | GetPosition1 () const |
| Retrieves the position of the reference coordinate system. | |
| void | SetPosition1 (const decVector &position) |
| Sets the position of the reference coordinate system. | |
| const decQuaternion & | GetOrientation1 () const |
| Retrieves the orientation of the reference coordinate system. | |
| void | SetOrientation1 (const decQuaternion &orientation) |
| Sets the orientation of the reference coordinate system. | |
| const decVector & | GetPosition2 () const |
| Retrieves the position of the reference coordinate system. | |
| void | SetPosition2 (const decVector &position) |
| Sets the position of the reference coordinate system. | |
| const decQuaternion & | GetOrientation2 () const |
| Retrieves the orientation of the reference coordinate system. | |
| void | SetOrientation2 (const decQuaternion &orientation) |
| Sets the orientation of the reference coordinate system. | |
| float | GetLowerLimitFor (int degreeOfFreedom) const |
| Retrieves the lower limit for the given degree of freedom. | |
| float | GetUpperLimitFor (int degreeOfFreedom) const |
| Retrieves the upper limit for the given degree of freedom. | |
| void | SetLimitsFor (int degreeOfFreedom, float lowerLimit, float upperLimit) |
| Sets the lower and upper limit. | |
| void | SetLockedFor (int degreeOfFreedom) |
| Sets the given degree of freedom to locked. | |
| void | SetFreeFor (int degreeOfFreedom) |
| Sets the given degree of freedom free. | |
| float | GetSpringStiffnessFor (int degreeOfFreedom) const |
| Retrieves the spring stiffness for the given degree of freedom. | |
| void | SetSpringStiffnessFor (int degreeOfFreedom, float stiffness) |
| Sets the spring stiffness of the given degree of freedom. | |
| decVector | GetLinearLowerLimits () const |
| Retrieves the lower limits for all linear degrees of freedom as a vector. | |
| decVector | GetLinearUpperLimits () const |
| Retrieves the upper limits for all linear degrees of freedom as a vector. | |
| void | SetLinearLimits (const decVector &lowerLimits, const decVector &upperLimits) |
| Sets the limits for linear all linear degrees of freedom from vectors. | |
| decVector | GetAngularLowerLimits () const |
| Retrieves the lower limits for all angular degrees of freedom as a vector. | |
| decVector | GetAngularUpperLimits () const |
| Retrieves the upper limits for all angular degrees of freedom as a vector. | |
| void | SetAngularLimits (const decVector &lowerLimits, const decVector &upperLimits) |
| Sets the limits for angular all angular degrees of freedom from vectors. | |
| decVector | GetLinearSpringStiffness () const |
| Retrieves the spring stiffness for all linear degrees of freedom as a vector. | |
| void | SetLinearSpringStiffness (const decVector &stiffness) |
| Sets the spring stiffness for linear all linear degrees of freedom from vectors. | |
| decVector | GetAngularSpringStiffness () const |
| Retrieves the spring stiffness for all angular degrees of freedom as a vector. | |
| void | SetAngularSpringStiffness (const decVector &stiffness) |
| Sets the spring stiffness for angular all angular degrees of freedom from vectors. | |
| float | GetLinearDamping () const |
| Retrieves the linear damping. | |
| void | SetLinearDamping (float damping) |
| Sets the linear damping. | |
| float | GetAngularDamping () const |
| Retrieves the angular damping. | |
| void | SetAngularDamping (float damping) |
| Sets the angular damping. | |
| float | GetSpringDamping () const |
| Retrieves the spring damping. | |
| void | SetSpringDamping (float damping) |
| Sets the spring damping. | |
| void | LockAll () |
| Locks all degrees of freedom. | |
| void | SetToBallJoint () |
| Locks all linear degrees of freedom and sets all angular degrees of freedom free. | |
| void | SetToHingeJoint (int degreeOfFreedom, float lowerLimit, float upperLimit) |
| Sets the upper and lower limit for the given angular degree of freedom and locks all others ( hinge joint ). | |
| void | SetToPistonJoint (int degreeOfFreedom, float lowerLimit, float upperLimit) |
| Sets the upper and lower limit for the given linear degree of freem and locks all others. | |
| void | SetSpringLinear1D (int degreeOfFreedom, float stiffness, float damping, float bendStiffness) |
| Sets a one-dimensional linear spring with bending properties. | |
| bool | GetIsRope () const |
| Determines if this constraint is a rope. | |
| void | SetIsRope (bool isRope) |
| Sets if this constraint is a rope. | |
| int | GetBone () const |
| Retrieves the bone index or -1 if attached to the entire component. | |
| void | SetBone (int bone) |
| Sets the bone index or -1 if attached to the entire component. | |
Collider Constraint.
Defines a constraint for a collider. Constraints can be used for colliders attached or colliders itself. If used on an attachement the attached collider is constraint to the parent collider. If used on a collider it is constraint to the static world. Constraints are defined in a generic way as a 6-Dof ( degreees of freedom ) type constraint. Two coordinate systems are defined for the two constraint partners. Each degree of freedom can be either locked, limited or free. If limited the upper and lower limit can be set. There are three linear and three angular degrees of freedom. The linear degrees of freedom allow the constraint partner to move translational relative to a given major axis whereas the angular degrees of freedom allow rotation about a major axis.
A degree of freedom is considered locked if the upper and lower limit are equal. It is considered free if the upper limit is smaller than the lower limit. In all other cases the degree of freedom is limited.
By default all degrees of freedom are locked.
In addition each degree of freedom can be turned into a spring type degree of freedom. A degree of freedom can be limited or free while being a spring or not. The spring is defined using the constants found in Hooke's Law therefore F=-k*x . The stiffness sprint constant equals to the k constant defining the percentage of the distance stretched away from the equilibrium position applied as force. Hence k is given as [N/m]. The spring damping determines the amount of energy lost over time. A stiffness of 0 disables spring behavior for a given degree of freedom.
A constraint can also be defined as a rope. If the constraint is a rope no collision shape is required on the affected colliders as the constraint itself becomes a rope shape.
| deColliderConstraint::deColliderConstraint | ( | ) |
Creates a new collider constraint.
| virtual deColliderConstraint::~deColliderConstraint | ( | ) | [virtual] |
Cleans up the collider constraint.
| float deColliderConstraint::GetAngularDamping | ( | ) | const [inline] |
Retrieves the angular damping.
| decVector deColliderConstraint::GetAngularLowerLimits | ( | ) | const [inline] |
Retrieves the lower limits for all angular degrees of freedom as a vector.
References elAngularX, elAngularY, and elAngularZ.
| decVector deColliderConstraint::GetAngularSpringStiffness | ( | ) | const [inline] |
Retrieves the spring stiffness for all angular degrees of freedom as a vector.
References elAngularX, elAngularY, and elAngularZ.
| decVector deColliderConstraint::GetAngularUpperLimits | ( | ) | const [inline] |
Retrieves the upper limits for all angular degrees of freedom as a vector.
References elAngularX, elAngularY, and elAngularZ.
| int deColliderConstraint::GetBone | ( | ) | const [inline] |
Retrieves the bone index or -1 if attached to the entire component.
| bool deColliderConstraint::GetIsRope | ( | ) | const [inline] |
Determines if this constraint is a rope.
| float deColliderConstraint::GetLinearDamping | ( | ) | const [inline] |
Retrieves the linear damping.
| decVector deColliderConstraint::GetLinearLowerLimits | ( | ) | const [inline] |
| decVector deColliderConstraint::GetLinearSpringStiffness | ( | ) | const [inline] |
| decVector deColliderConstraint::GetLinearUpperLimits | ( | ) | const [inline] |
| float deColliderConstraint::GetLowerLimitFor | ( | int | degreeOfFreedom ) | const |
Retrieves the lower limit for the given degree of freedom.
| const decQuaternion& deColliderConstraint::GetOrientation1 | ( | ) | const [inline] |
Retrieves the orientation of the reference coordinate system.
| const decQuaternion& deColliderConstraint::GetOrientation2 | ( | ) | const [inline] |
Retrieves the orientation of the reference coordinate system.
| const decVector& deColliderConstraint::GetPosition1 | ( | ) | const [inline] |
Retrieves the position of the reference coordinate system.
| const decVector& deColliderConstraint::GetPosition2 | ( | ) | const [inline] |
Retrieves the position of the reference coordinate system.
| float deColliderConstraint::GetSpringDamping | ( | ) | const [inline] |
Retrieves the spring damping.
| float deColliderConstraint::GetSpringStiffnessFor | ( | int | degreeOfFreedom ) | const |
Retrieves the spring stiffness for the given degree of freedom.
| float deColliderConstraint::GetUpperLimitFor | ( | int | degreeOfFreedom ) | const |
Retrieves the upper limit for the given degree of freedom.
| void deColliderConstraint::LockAll | ( | ) |
Locks all degrees of freedom.
| void deColliderConstraint::SetAngularDamping | ( | float | damping ) |
Sets the angular damping.
| void deColliderConstraint::SetAngularLimits | ( | const decVector & | lowerLimits, |
| const decVector & | upperLimits | ||
| ) |
Sets the limits for angular all angular degrees of freedom from vectors.
| void deColliderConstraint::SetAngularSpringStiffness | ( | const decVector & | stiffness ) |
Sets the spring stiffness for angular all angular degrees of freedom from vectors.
| void deColliderConstraint::SetBone | ( | int | bone ) |
Sets the bone index or -1 if attached to the entire component.
| void deColliderConstraint::SetFreeFor | ( | int | degreeOfFreedom ) |
Sets the given degree of freedom free.
| void deColliderConstraint::SetIsRope | ( | bool | isRope ) |
Sets if this constraint is a rope.
| void deColliderConstraint::SetLimitsFor | ( | int | degreeOfFreedom, |
| float | lowerLimit, | ||
| float | upperLimit | ||
| ) |
Sets the lower and upper limit.
| void deColliderConstraint::SetLinearDamping | ( | float | damping ) |
Sets the linear damping.
| void deColliderConstraint::SetLinearLimits | ( | const decVector & | lowerLimits, |
| const decVector & | upperLimits | ||
| ) |
Sets the limits for linear all linear degrees of freedom from vectors.
| void deColliderConstraint::SetLinearSpringStiffness | ( | const decVector & | stiffness ) |
Sets the spring stiffness for linear all linear degrees of freedom from vectors.
| void deColliderConstraint::SetLockedFor | ( | int | degreeOfFreedom ) |
Sets the given degree of freedom to locked.
| void deColliderConstraint::SetOrientation1 | ( | const decQuaternion & | orientation ) |
Sets the orientation of the reference coordinate system.
| void deColliderConstraint::SetOrientation2 | ( | const decQuaternion & | orientation ) |
Sets the orientation of the reference coordinate system.
| void deColliderConstraint::SetPosition1 | ( | const decVector & | position ) |
Sets the position of the reference coordinate system.
| void deColliderConstraint::SetPosition2 | ( | const decVector & | position ) |
Sets the position of the reference coordinate system.
| void deColliderConstraint::SetSpringDamping | ( | float | damping ) |
Sets the spring damping.
| void deColliderConstraint::SetSpringLinear1D | ( | int | degreeOfFreedom, |
| float | stiffness, | ||
| float | damping, | ||
| float | bendStiffness | ||
| ) |
Sets a one-dimensional linear spring with bending properties.
The given linear degree of freedom is set free with the given spring stiffness and damping. All other linear degrees of freedom are set free to with the given bending stiffness and damping. All angular degrees of freedom are locked.
| void deColliderConstraint::SetSpringStiffnessFor | ( | int | degreeOfFreedom, |
| float | stiffness | ||
| ) |
Sets the spring stiffness of the given degree of freedom.
| void deColliderConstraint::SetToBallJoint | ( | ) |
Locks all linear degrees of freedom and sets all angular degrees of freedom free.
| void deColliderConstraint::SetToHingeJoint | ( | int | degreeOfFreedom, |
| float | lowerLimit, | ||
| float | upperLimit | ||
| ) |
Sets the upper and lower limit for the given angular degree of freedom and locks all others ( hinge joint ).
| void deColliderConstraint::SetToPistonJoint | ( | int | degreeOfFreedom, |
| float | lowerLimit, | ||
| float | upperLimit | ||
| ) |
Sets the upper and lower limit for the given linear degree of freem and locks all others.
1.7.2