An all-in-one constraint capable to replace all other types of constraints. It is always recommended to use the optimized version of the constraint for the type of task you want to do. However, in the case you want to combine multiple types of constraints nto one; or if a more specific but optimized constraint version does not give you the amount of flexibility you require it is then recommended to use a generic constraint.
Generic constraints provide six degrees of freedom with or without spring capabilities; they are more CPU intensive compared to the other (more specific) type of constraints since these are built to achieve one specific task only.
Name | Description |
rigidconstraint | Parent RigidConstraint the active GenericConstraint is associated to. |
Declaration RigidConstraint *rigidconstraint
|
linear_lower_limit | Minimum limit of the box that defines the constraint linear movements. |
Declaration
|
linear_upper_limit | Maximum limit of the box that defines the constraint linear movements. |
Declaration
|
angular_lower_limit | Lower angular limits of the constraint specified for each rotational axis. |
Declaration Range -180.0 to 180.0
|
angular_upper_limit | Upper angular limits of the constraint specified for each rotational axis. |
Declaration Range -180.0 to 180.0
|
motor_linear_target_velocity | The targeted linear velocity the motor will try to reach on each linear axis. |
Declaration vec3 motor_linear_target_velocity
|
motor_linear_max_force | Maximum amount of linear force to apply on each linear axis. |
Declaration vec3 motor_linear_max_force
|
motor_linear_softness | Percentage of limits where the linear movement is free, beyond this value limits will gradually be reinforced until the hard limit of 1.0 is reached. |
Declaration vec3 motor_linear_softness
|
motor_linear_damping | Improve the stability of linear low pass jitter. |
Declaration vec3 motor_linear_damping
|
motor_linear_restitution | Bounciness factor of the constraint on each linear axis. |
Declaration vec3 motor_linear_restitution
|
motor_spring_linear_equilibrium_point | The linear spring motor equilibrium point. |
Declaration vec3 motor_spring_linear_equilibrium_point
|
motor_spring_linear_stiffness | Defines the amount of linear stiffness the spring motor will apply on each linear axis. |
Declaration vec3 motor_spring_linear_stiffness
|
motor_spring_linear_damping | Spring damping value to use for each axis to stabilize low pass jittering. |
Declaration vec3 motor_spring_linear_damping
|
motor_angular_target_velocity | Targeted angular velocity the motor will try to reach for each rotational axis. |
Declaration vec3 motor_angular_target_velocity
|
motor_angular_max_force | Maximum amount of angular force that the motor will apply on each rotational axis. |
Declaration vec3 motor_angular_max_force
|
motor_angular_max_force_limits | The constraint force limit for each rotational axis. |
Declaration vec3 motor_angular_max_force_limits
|
motor_angular_softness | Percentage of limits where the rotational movement is free, beyond this percentage, the angular limit will gradually be reinforced until the hard limit of 1.0 (100%) is reached. |
Declaration vec3 motor_angular_softness
|
motor_angular_damping | Value to improve the constraint's stability of angular low pass jitter. |
Declaration vec3 motor_angular_damping
|
motor_angular_restitution | Bounciness factor of the constraint for each angular axis. |
Declaration vec3 motor_angular_restitution
|
motor_spring_angular_equilibrium_point | The angular spring motor equilibrium point. |
Declaration vec3 motor_spring_angular_equilibrium_point
|
motor_spring_angular_stiffness | Amount of angular stiffness the spring motor will apply on each axis. |
Declaration vec3 motor_spring_angular_stiffness
|
motor_spring_angular_damping | Spring damping value to use for each rotational axis to stabilize low pass jittering. |
Declaration vec3 motor_spring_angular_damping
|
cfm_linear | Linear constant force mix factor. |
Declaration Range -0.1 to 1.0
|
cfm_stop_linear | Linear constant force mix factor when the constraint`s linear limits are reached. |
Declaration Range -0.1 to 1.0
|
cfm_angular | Angular constant force mix factor. |
Declaration Range -0.1 to 1.0
|
cfm_stop_angular | Angular constant force mix factor when the constraint`s linear limits are reached. |
Declaration Range -0.1 to 1.0
|
erp_stop_linear | Linear error reduction parameters when the constraint reached a linear limit. |
Declaration Range -0.1 to 1.0
|
erp_stop_angular | The angular error reduction parameters when the constraint reached an angular limit. |
Declaration Range -0.1 to 1.0
|
motor_linear_x | Current linear MotorType used by the linear X axis. |
Declaration
|
motor_linear_y | Current linear MotorType used by the linear Y axis. |
Declaration
|
motor_linear_z | Current linear MotorType used by the linear Z axis. |
Declaration
|
motor_angular_x | Current linear MotorType used by the angular X axis. |
Declaration MotorType motor_angular_x
|
motor_angular_y | Current linear MotorType used by the angular Y axis. |
Declaration MotorType motor_angular_y
|
motor_angular_z | Current linear MotorType used by the angular Z axis. |
Declaration MotorType motor_angular_z
|
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.
|
Clear | Setup the linear and angular limits of the GenericConstraint. |
Declaration void SetLimits( const vec3 linear_lower_limit, const vec3 linear_upper_limit, const vec3 angular_lower_limit, const vec3 angular_upper_limit ) Parameters
linear_lower_limit : Lower limit for each axis (bottom left of the AABB).
linear_upper_limit : Upper limit for each axis (upper right of the AABB).
angular_lower_limit : Lower angular limit ranging from -180 to 180 degree.
angular_upper_limit : Upper angular limit ranging from -180 to 180 degree.
|
SetLinearMotor | Controls the linear motor settings. |
Declaration void SetLinearMotor( const MotorType motor_linear_x, const MotorType motor_linear_y, const MotorType motor_linear_z, const vec3 motor_linear_target_velocity, const vec3 motor_linear_max_force, float motor_linear_softness, float motor_linear_damping, float motor_linear_restitution, const vec3 motor_spring_linear_equilibrium_point, const vec3 motor_spring_linear_stiffness, const vec3 motor_spring_linear_damping ) Parameters
motor_linear_x : The MotorType to use for the X axis.
motor_linear_y : The MotorType to use for the Y axis.
motor_linear_z : The MotorType to use for the Z axis.
motor_linear_target_velocity : Specify the linear velocity to reach for each axis.
motor_linear_max_force : Defines the maximum force the motor for each axis can reach.
motor_linear_softness : Specify the percentage of limits where the linear movement is free.
motor_linear_damping : Tweak to stabilize linear low pass jitter.
motor_linear_restitution : Controls how springy the linear motor will be.
motor_spring_linear_equilibrium_point : Setup the equilibrium point of the linear spring.
motor_spring_linear_stiffness : Controls the level of stiffness for each linear motor axis.
motor_spring_linear_damping : Tweak to stabilize the spring linear motor low pass jitter.
|
SetAngularMotor | Controls the linear motor settings. |
Declaration void SetAngularMotor( MotorType motor_angular_x, const MotorType motor_angular_y, const MotorType motor_angular_z, const vec3 motor_angular_target_velocity, const vec3 motor_angular_max_force, const vec3 motor_angular_max_force_limits, const vec3 motor_angular_softness, const vec3 motor_angular_damping, const vec3 motor_angular_restitution, const vec3 motor_spring_angular_equilibrium_point, const vec3 motor_spring_angular_stiffness, const vec3 motor_spring_angular_damping ) Parameters
motor_angular_x : The MotorType to use for the X axis.
motor_angular_y : The MotorType to use for the Y axis.
motor_angular_z : The MotorType to use for the Z axis.
motor_angular_target_velocity : Specify the rotational velocity to reach on each axis.
motor_angular_max_force : Defines the maximum angular force the motor can reach on each axis.
motor_angular_softness : Specify the percentage of limits where the angular movement is free.
motor_angular_damping : Tweak this value to stabilize the rotational low pass jitter.
motor_angular_restitution : Controls how springy the rotational motor can be.
motor_spring_angular_equilibrium_point : Setup the equilibrium point of the angular spring.
motor_spring_angular_stiffness : Controls the level of stiffness for each rotational motor axis.
motor_spring_angular_damping : Tweak this value to stabilize the spring angular motor low pass jitter.
|
SetOverridesCFM | Allows you to overrides the default CFM (constant force mixing) values. |
Declaration void SetOverridesCFM( const vec3 cfm_linear, const vec3 cfm_stop_linear, const vec3 cfm_angular, const vec3 cfm_stop_angular ) Parameters
cfm_linear : The linear constant force mix factor to use.
cfm_stop_linear : Specify the constant force mix factor to use when a linear limit is reached.
cfm_angular : The angular constant force mix factor to use.
cfm_stop_angular : Control the constant force mix factor to use when reaching an angular limit.
- 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.
|
SetOverridesERP | Allows you to overrides the default ERP (error reduction parameters) values. |
Declaration void SetOverridesERP( const vec3 erp_stop_linear, const vec3 erp_stop_angular ) Parameters
erp_stop_linear : The stop linear error reduction parameter.
erp_stop_angular : Specify the stop angular error reduction parameter.
- Note
- All value should be in the range of
0.0 to 1.0 ; a value is lower than 0.0 will tell the system to use the preset value for the respective parameter.
|
GetLocation | Retrieve the GenericConstraint current location point. |
Declaration Return Value
A tri-dimensional vector containing the active location of the GenericConstraint.
|
GetLocation | Get the current GenericConstraint rotational angles (in degrees). |
Declaration Return Value
Current rotational vector applied by the constraint.
|