Generic6DOFJoint3D
Inherits: Joint3D < Entity3D < Entity < Object
Description
Section titled “Description”A physics joint that allows for complex movement and rotation between two 3D physics bodies.
The Generic6DOFJoint3D (6 Degrees Of Freedom) joint allows for implementing custom types of joints by locking the rotation and translation of certain axes.
The first 3 DOF represent the linear motion of the physics bodies and the last 3 DOF represent the angular motion of the physics bodies. Each axis can be either locked, or limited.
Properties
Section titled “Properties”Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | clear_angular_target_rotation() |
| Quaternion | get_angular_target_rotation() const |
| bool | get_flag_x(flag: Flag) const |
| bool | get_flag_y(flag: Flag) const |
| bool | get_flag_z(flag: Flag) const |
| float | get_param_x(param: Param) const |
| float | get_param_y(param: Param) const |
| float | get_param_z(param: Param) const |
| bool | has_target_rotation() const |
| void | set_angular_target_rotation(target_rotation: Quaternion) |
| void | set_flag_x(flag: Flag, value: bool) |
| void | set_flag_y(flag: Flag, value: bool) |
| void | set_flag_z(flag: Flag, value: bool) |
| void | set_param_x(param: Param, value: float) |
| void | set_param_y(param: Param, value: float) |
| void | set_param_z(param: Param, value: float) |
Enumerations
Section titled “Enumerations”Param
enum Param
PARAM_LINEAR_LOWER_LIMIT = 0
The minimum difference between the pivot points’ axes.
PARAM_LINEAR_UPPER_LIMIT = 1
The maximum difference between the pivot points’ axes.
PARAM_LINEAR_LIMIT_SOFTNESS = 2
A factor applied to the movement across the axes. The lower, the slower the movement.
PARAM_LINEAR_RESTITUTION = 3
The amount of restitution on the axes’ movement. The lower, the more momentum gets lost.
PARAM_LINEAR_DAMPING = 4
The amount of damping that happens at the linear motion across the axes.
PARAM_LINEAR_MOTOR_TARGET_VELOCITY = 5
The velocity the linear motor will try to reach.
PARAM_LINEAR_SPRING_STIFFNESS = 6
PARAM_LINEAR_SPRING_DAMPING = 7
PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT = 8
PARAM_ANGULAR_LOWER_LIMIT = 9
The minimum rotation in negative direction to break loose and rotate around the axes.
PARAM_ANGULAR_UPPER_LIMIT = 10
The minimum rotation in positive direction to break loose and rotate around the axes.
PARAM_ANGULAR_LIMIT_SOFTNESS = 11
The speed of all rotations across the axes.
PARAM_ANGULAR_DAMPING = 12
The amount of rotational damping across the axes. The lower, the more damping occurs.
PARAM_ANGULAR_RESTITUTION = 13
The amount of rotational restitution across the axes. The lower, the more restitution occurs.
PARAM_ANGULAR_FORCE_LIMIT = 14
The maximum amount of force that can occur, when rotating around the axes.
PARAM_ANGULAR_ERP = 15
When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
PARAM_ANGULAR_MOTOR_TARGET_VELOCITY = 16
Target speed for the motor at the axes.
PARAM_ANGULAR_SPRING_STIFFNESS = 17
PARAM_ANGULAR_SPRING_DAMPING = 18
PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT = 19
PARAM_LINEAR_DRIVE_FORCE_LIMIT = 20
The maximum force the joint can apply along this linear axis.
Used by both the spring drive and the linear motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
PARAM_ANGULAR_DRIVE_TORQUE_LIMIT = 21
The maximum torque the joint can apply around this angular axis.
Used by both the spring drive and the angular motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
PARAM_MAX = 22
Represents the size of the Param enum.
Flag
enum Flag
FLAG_ENABLE_LINEAR_LIMIT = 0
If enabled, linear motion is possible within the given limits.
FLAG_ENABLE_ANGULAR_LIMIT = 1
If enabled, rotational motion is possible within the given limits.
FLAG_ENABLE_LINEAR_SPRING = 3
FLAG_ENABLE_ANGULAR_SPRING = 2
FLAG_ENABLE_ANGULAR_MOTOR = 4
If enabled, there is a rotational or angular motor across these axes.
FLAG_ENABLE_LINEAR_MOTOR = 5
If enabled, there is a linear motor across these axes.
FLAG_MAX = 6
Represents the size of the Flag enum.
Property descriptions
Section titled “Property descriptions”angular_drive_x/torque_limit
float angular_drive_x/torque_limit = 3.4028235e+38
The maximum torque the joint can apply around the X angular axis. Used by both the spring drive and the angular motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
angular_drive_y/torque_limit
float angular_drive_y/torque_limit = 3.4028235e+38
The maximum torque the joint can apply around the Y angular axis. Used by both the spring drive and the angular motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
angular_drive_z/torque_limit
float angular_drive_z/torque_limit = 3.4028235e+38
The maximum torque the joint can apply around the Z angular axis. Used by both the spring drive and the angular motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
angular_limit_x/damping
float angular_limit_x/damping = 1.0
The amount of rotational damping across the X axis.
The lower, the longer an impulse from one side takes to travel to the other side.
angular_limit_x/enabled
bool angular_limit_x/enabled = true
If true, rotation across the X axis is limited.
angular_limit_x/erp
float angular_limit_x/erp = 0.5
When rotating across the X axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
angular_limit_x/force_limit
float angular_limit_x/force_limit = 0.0
The maximum amount of force that can occur, when rotating around the X axis.
angular_limit_x/lower_angle
float angular_limit_x/lower_angle = 0.0
The minimum rotation in negative direction to break loose and rotate around the X axis.
angular_limit_x/restitution
float angular_limit_x/restitution = 0.0
The amount of rotational restitution across the X axis. The lower, the more restitution occurs.
angular_limit_x/softness
float angular_limit_x/softness = 0.5
The speed of all rotations across the X axis.
angular_limit_x/upper_angle
float angular_limit_x/upper_angle = 0.0
The minimum rotation in positive direction to break loose and rotate around the X axis.
angular_limit_y/damping
float angular_limit_y/damping = 1.0
The amount of rotational damping across the Y axis. The lower, the more damping occurs.
angular_limit_y/enabled
bool angular_limit_y/enabled = true
If true, rotation across the Y axis is limited.
angular_limit_y/erp
float angular_limit_y/erp = 0.5
When rotating across the Y axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
angular_limit_y/force_limit
float angular_limit_y/force_limit = 0.0
The maximum amount of force that can occur, when rotating around the Y axis.
angular_limit_y/lower_angle
float angular_limit_y/lower_angle = 0.0
The minimum rotation in negative direction to break loose and rotate around the Y axis.
angular_limit_y/restitution
float angular_limit_y/restitution = 0.0
The amount of rotational restitution across the Y axis. The lower, the more restitution occurs.
angular_limit_y/softness
float angular_limit_y/softness = 0.5
The speed of all rotations across the Y axis.
angular_limit_y/upper_angle
float angular_limit_y/upper_angle = 0.0
The minimum rotation in positive direction to break loose and rotate around the Y axis.
angular_limit_z/damping
float angular_limit_z/damping = 1.0
The amount of rotational damping across the Z axis. The lower, the more damping occurs.
angular_limit_z/enabled
bool angular_limit_z/enabled = true
If true, rotation across the Z axis is limited.
angular_limit_z/erp
float angular_limit_z/erp = 0.5
When rotating across the Z axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
angular_limit_z/force_limit
float angular_limit_z/force_limit = 0.0
The maximum amount of force that can occur, when rotating around the Z axis.
angular_limit_z/lower_angle
float angular_limit_z/lower_angle = 0.0
The minimum rotation in negative direction to break loose and rotate around the Z axis.
angular_limit_z/restitution
float angular_limit_z/restitution = 0.0
The amount of rotational restitution across the Z axis. The lower, the more restitution occurs.
angular_limit_z/softness
float angular_limit_z/softness = 0.5
The speed of all rotations across the Z axis.
angular_limit_z/upper_angle
float angular_limit_z/upper_angle = 0.0
The minimum rotation in positive direction to break loose and rotate around the Z axis.
angular_motor_x/enabled
bool angular_motor_x/enabled = false
If true, a rotating motor at the X axis is enabled.
angular_motor_x/target_velocity
float angular_motor_x/target_velocity = 0.0
Target speed for the motor at the X axis.
angular_motor_y/enabled
bool angular_motor_y/enabled = false
If true, a rotating motor at the Y axis is enabled.
angular_motor_y/target_velocity
float angular_motor_y/target_velocity = 0.0
Target speed for the motor at the Y axis.
angular_motor_z/enabled
bool angular_motor_z/enabled = false
If true, a rotating motor at the Z axis is enabled.
angular_motor_z/target_velocity
float angular_motor_z/target_velocity = 0.0
Target speed for the motor at the Z axis.
angular_spring_x/damping
float angular_spring_x/damping = 0.0
angular_spring_x/enabled
bool angular_spring_x/enabled = false
angular_spring_x/equilibrium_point
float angular_spring_x/equilibrium_point = 0.0
angular_spring_x/stiffness
float angular_spring_x/stiffness = 0.0
angular_spring_y/damping
float angular_spring_y/damping = 0.0
angular_spring_y/enabled
bool angular_spring_y/enabled = false
angular_spring_y/equilibrium_point
float angular_spring_y/equilibrium_point = 0.0
angular_spring_y/stiffness
float angular_spring_y/stiffness = 0.0
angular_spring_z/damping
float angular_spring_z/damping = 0.0
angular_spring_z/enabled
bool angular_spring_z/enabled = false
angular_spring_z/equilibrium_point
float angular_spring_z/equilibrium_point = 0.0
angular_spring_z/stiffness
float angular_spring_z/stiffness = 0.0
linear_drive_x/force_limit
float linear_drive_x/force_limit = 3.4028235e+38
The maximum force the joint can apply along the X linear axis. Used by both the spring drive and the linear motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
linear_drive_y/force_limit
float linear_drive_y/force_limit = 3.4028235e+38
The maximum force the joint can apply along the Y linear axis. Used by both the spring drive and the linear motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
linear_drive_z/force_limit
float linear_drive_z/force_limit = 3.4028235e+38
The maximum force the joint can apply along the Z linear axis. Used by both the spring drive and the linear motor.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
linear_limit_x/damping
float linear_limit_x/damping = 1.0
The amount of damping that happens at the X motion.
linear_limit_x/enabled
bool linear_limit_x/enabled = true
If true, the linear motion across the X axis is limited.
linear_limit_x/lower_distance
float linear_limit_x/lower_distance = 0.0
The minimum difference between the pivot points’ X axis.
linear_limit_x/restitution
float linear_limit_x/restitution = 0.5
The amount of restitution on the X axis movement. The lower, the more momentum gets lost.
linear_limit_x/softness
float linear_limit_x/softness = 0.7
A factor applied to the movement across the X axis. The lower, the slower the movement.
linear_limit_x/upper_distance
float linear_limit_x/upper_distance = 0.0
The maximum difference between the pivot points’ X axis.
linear_limit_y/damping
float linear_limit_y/damping = 1.0
The amount of damping that happens at the Y motion.
linear_limit_y/enabled
bool linear_limit_y/enabled = true
If true, the linear motion across the Y axis is limited.
linear_limit_y/lower_distance
float linear_limit_y/lower_distance = 0.0
The minimum difference between the pivot points’ Y axis.
linear_limit_y/restitution
float linear_limit_y/restitution = 0.5
The amount of restitution on the Y axis movement. The lower, the more momentum gets lost.
linear_limit_y/softness
float linear_limit_y/softness = 0.7
A factor applied to the movement across the Y axis. The lower, the slower the movement.
linear_limit_y/upper_distance
float linear_limit_y/upper_distance = 0.0
The maximum difference between the pivot points’ Y axis.
linear_limit_z/damping
float linear_limit_z/damping = 1.0
The amount of damping that happens at the Z motion.
linear_limit_z/enabled
bool linear_limit_z/enabled = true
If true, the linear motion across the Z axis is limited.
linear_limit_z/lower_distance
float linear_limit_z/lower_distance = 0.0
The minimum difference between the pivot points’ Z axis.
linear_limit_z/restitution
float linear_limit_z/restitution = 0.5
The amount of restitution on the Z axis movement. The lower, the more momentum gets lost.
linear_limit_z/softness
float linear_limit_z/softness = 0.7
A factor applied to the movement across the Z axis. The lower, the slower the movement.
linear_limit_z/upper_distance
float linear_limit_z/upper_distance = 0.0
The maximum difference between the pivot points’ Z axis.
linear_motor_x/enabled
bool linear_motor_x/enabled = false
If true, then there is a linear motor on the X axis. It will attempt to reach the target velocity while staying within the force limits.
linear_motor_x/target_velocity
float linear_motor_x/target_velocity = 0.0
The speed that the linear motor will attempt to reach on the X axis.
linear_motor_y/enabled
bool linear_motor_y/enabled = false
If true, then there is a linear motor on the Y axis. It will attempt to reach the target velocity while staying within the force limits.
linear_motor_y/target_velocity
float linear_motor_y/target_velocity = 0.0
The speed that the linear motor will attempt to reach on the Y axis.
linear_motor_z/enabled
bool linear_motor_z/enabled = false
If true, then there is a linear motor on the Z axis. It will attempt to reach the target velocity while staying within the force limits.
linear_motor_z/target_velocity
float linear_motor_z/target_velocity = 0.0
The speed that the linear motor will attempt to reach on the Z axis.
linear_spring_x/damping
float linear_spring_x/damping = 0.01
linear_spring_x/enabled
bool linear_spring_x/enabled = false
linear_spring_x/equilibrium_point
float linear_spring_x/equilibrium_point = 0.0
linear_spring_x/stiffness
float linear_spring_x/stiffness = 0.01
linear_spring_y/damping
float linear_spring_y/damping = 0.01
linear_spring_y/enabled
bool linear_spring_y/enabled = false
linear_spring_y/equilibrium_point
float linear_spring_y/equilibrium_point = 0.0
linear_spring_y/stiffness
float linear_spring_y/stiffness = 0.01
linear_spring_z/damping
float linear_spring_z/damping = 0.01
linear_spring_z/enabled
bool linear_spring_z/enabled = false
linear_spring_z/equilibrium_point
float linear_spring_z/equilibrium_point = 0.0
linear_spring_z/stiffness
float linear_spring_z/stiffness = 0.01
Method descriptions
Section titled “Method descriptions”clear_angular_target_rotation
void clear_angular_target_rotation()
Clears the quaternion angular target. After clearing, the joint is driven by PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT on each axis as configured.
get_angular_target_rotation
Quaternion get_angular_target_rotation() const
Returns the joint’s current angular target as a body-space quaternion. If no explicit target was set via set_angular_target_rotation(), the value is derived from PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT on backends that support it; other backends return the identity quaternion.
get_flag_x
bool get_flag_x(flag: Flag) const
get_flag_y
bool get_flag_y(flag: Flag) const
get_flag_z
bool get_flag_z(flag: Flag) const
get_param_x
float get_param_x(param: Param) const
get_param_y
float get_param_y(param: Param) const
get_param_z
float get_param_z(param: Param) const
has_target_rotation
bool has_target_rotation() const
Returns true if a quaternion angular target was explicitly set via set_angular_target_rotation() and has not been cleared. Returns false when the joint is driven by PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT only.
set_angular_target_rotation
void set_angular_target_rotation(target_rotation: Quaternion)
Sets the target angular orientation as a body-space quaternion describing the desired orientation of body B relative to body A. Replaces any previously set target and supersedes PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT until clear_angular_target_rotation() is called.
Note: Only for Jolt backend. Other 3D physics backends may ignore this value.
set_flag_x
void set_flag_x(flag: Flag, value: bool)
set_flag_y
void set_flag_y(flag: Flag, value: bool)
set_flag_z
void set_flag_z(flag: Flag, value: bool)
set_param_x
void set_param_x(param: Param, value: float)
set_param_y
void set_param_y(param: Param, value: float)
