Creates a movable joint or mechanism like the one found door, gate, or lid that swings as it opens and closes or which connects two linked physic objects.
See Also
Static Variables
Name | Description |
rigidconstraint | Underlying RigidConstraint associated to the current hinge. |
Declaration RigidConstraint *rigidconstraint
|
angular_lower_limit | Lower angular limit of the hinge in degree. |
Declaration float angular_lower_limit Range -180.0 to 180.0
|
angular_upper_limit | Upper angular limit of the hinge in degree; ranging from -180 to 180. |
Declaration float angular_upper_limit Range -180.0 to 180.0
|
softness | Percentage of limits where the movement is free, beyond this value the limit is reinforced until the hard limit of 1.0 is reached. |
Declaration Range 0.0 to 1.0
|
bias | Strength with which the constraint resists zeroth order limit violation. |
Declaration Range 0.0 to 1.0
|
relaxation | The nearest to 0 the value is the less the constraint will fight velocities that violates angular limits. |
Declaration Range 0.0 to 1.0
|
motor_enabled | Enable or disable a constant motor force on the hinge. |
Declaration
|
motor_target_velocity | Specify the targeted amount of velocity the motor should reach. |
Declaration float motor_target_velocity
|
motor_max_impulse | Controls the maximum impulse value the motor will be generating. |
Declaration
|
cfm | Controls the default constant force mixing. |
Declaration Range -0.1 to 1.0
|
cfm_stop | Controls the force mix factor to use when upper or lower limits are reached. |
Declaration Range -0.1 to 1.0
|
erp_stop | Controls the default constant force mixing. |
Declaration Range -0.1 to 1.0
|
Variables
Functions
Name | Description |
SetFrames | Specify the HingeConstraint frames that creates the constraint. |
Declaration void SetFrames( const vec3 pivotA, const vec3 rotationA, const vec3 pivotB, const vec3 rotationB ) Parameters
pivotA : Specify the first pivot location.
rotationA : Set the rotation angles of the first pivot.
pivotB : Specify the second pivot location.
rotationB : Set the second pivot rotation angles.
|
SetLimits | Specify the HingeConstraint limites. |
Declaration void SetLimits( float angular_lower_limit, float angular_upper_limit, float softness, float bias, float relaxation ) Parameters
angular_lower_limit : The angular lower limit specified as angle.
angular_upper_limit : The upper angular limit specified as angle.
softness : Percentage of limits where the movement is free.
bias : Strength with which the constraint resists zeroth order limit violation.
relaxation : Specify how much the constraint will fight velocities which violate angular limits.
|
SetMotor | Control the motor of the active HingeConstraint. |
Declaration void SetMotor( bool motor_enabled, float motor_target_velocity, float motor_max_impulse ) Parameters
motor_enabled : Enable or disable impulse motor.
motor_target_velocity : Specify the targeted velocity the motor should reach.
motor_max_impulse : Specify the maximum impulse the motor should apply.
|
SetOverrides | Overrides the default HingeConstraint force mixing and error reduction parameter. |
Declaration void SetOverrides( float cfm, float cfm_stop, float erp_stop ) Parameters
cfm : Constant force mixing factor.
cfm_stop : Constant force mixing factor when hitting the limits.
erp_stop : Error reduction parameter when hitting limits.
|
GetAngle | Return the current hinge angle in degree. |
Declaration Return Value
The current angle of the hinge in degree.
|