A special type of RigidConstraint that force a PhysicObject to remain a certain distance from a predefined cone, limiting its rotation.
See Also
Static Variables
Name | Description |
rigidconstraint | Parent RigidConstraint responsible of maintaining the active TwistConstraint. |
Declaration RigidConstraint *rigidconstraint
|
angular_limit | Controls the rotational limit of the TwistConstraint for each axis. |
Declaration Range -180.0 to 180.0
|
softness | Describes the percentage of limits where the movement is free, beyond this percentage, the limit is gradually reinforced until the hard limit (1.0) is reached. |
Declaration Range 0.0 to 1.0
|
bias | Strength with which the constraint resists zeroth order (angular, not angular velocity) limit violation. |
Declaration Range 0.0 to 1.0
|
relaxation | The lower the value the less the constraint will fight velocities which violate angular limits. |
Declaration Range 0.0 to 1.0
|
fix_threshold | The threshold to used to force solving the swing limit of the constraint. |
Declaration Range 0.0 to 1.0
|
motor_enabled | Enable angular motor force. |
Declaration
|
motor_normalize_impulse | Normalize the motor impulse strength. |
Declaration bool motor_normalize_impulse
|
motor_angular_target | The motor target rotation on each axis. |
Declaration vec3 motor_angular_target
|
motor_max_impulse | Maximum impulse factor that will be accumulated by the motor. |
Declaration
|
cfm_linear | The linear constant force mixing factor. |
Declaration Range -0.1 to 1.0
|
cfm_angular | The angular constant force mixing factor. |
Declaration Range -0.1 to 1.0
|
erp_linear | Control the error reduction parameter to use by the constraint solver. |
Declaration Range -0.1 to 1.0
|
Functions
Name | Description |
SetFrames | Build the constraint frames between two rigid bodies. |
Declaration void SetFrames( const vec3 pivotA, const vec3 rotationA, const vec3 pivotB, const vec3 rotationB ) Parameters
pivotA : Local pivot point located on the first rigid body.
rotationA : Local rotation relative to the first rigid body.
pivotB : Local pivot point located on the second rigid body.
rotationB : Local rotation relative to the second rigid body.
|
SetLimits | Setup the limit parameters of the active TwistConstraint. |
Declaration void SetLimits( const vec3 angular_limit, float softness, float bias, float relaxation, float fix_threshold ) Parameters
angular_limit : The rotational angle limit to use for each axis.
softness : The percentage of movement limits.
bias : Strength with which the constraint resists zeroth order.
relaxation : Control how the constraint fight velocities that violates angular limits.
fix_threshold : Force solving the swing limits.
|
SetMotor | Enable or disable angular motor (and setup its parameter) for the active TwistConstraint. |
Declaration void SetMotor( bool motor_enabled, bool motor_normalize_impulse, const vec3 motor_angular_target, float motor_max_impulse ) Parameters
motor_enabled : Controls the motor availability.
motor_normalize_impulse : Force to normalize the motor impulse.
motor_angular_target : Setup the motor angular target.
motor_max_impulse : Maximum amount of impulse the mother can produce.
|
SetOverrides | Function that allows you to overrides the default CFM and ERP values. |
Declaration void SetOverrides( float cfm_linear, float cfm_angular, float erp_linear ) Parameters
cfm_linear : The linear constant force mix factor to use.
cfm_angular : The angular constant force mix factor to use.
erp_linear : Specify the error reduction parameter to use.
- Note
- All value should not exceed
1.0 ; a value is lower than 0.0 tell the system to use them default preset for the constraint.
|
GetAngle | Helper that retrieve the current angle (in degree) of the TwistConstraint. |
Declaration Return Value
The current angle of the TwistConstraint.
|