Up to date
This page is up to date for Godot 4.1
.
If you still find outdated information, please open an issue.
Generic6DOFJoint3D¶
Inherits: Joint3D < Node3D < Node < Object
A physics joint that allows for complex movement and rotation between two 3D physics bodies.
Description¶
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¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
get_flag_x ( Flag flag ) const |
|
get_flag_y ( Flag flag ) const |
|
get_flag_z ( Flag flag ) const |
|
get_param_x ( Param param ) const |
|
get_param_y ( Param param ) const |
|
get_param_z ( Param param ) const |
|
void |
set_flag_x ( Flag flag, bool value ) |
void |
set_flag_y ( Flag flag, bool value ) |
void |
set_flag_z ( Flag flag, bool value ) |
void |
set_param_x ( Param param, float value ) |
void |
set_param_y ( Param param, float value ) |
void |
set_param_z ( Param param, float value ) |
Enumerations¶
enum Param:
Param PARAM_LINEAR_LOWER_LIMIT = 0
The minimum difference between the pivot points' axes.
Param PARAM_LINEAR_UPPER_LIMIT = 1
The maximum difference between the pivot points' axes.
Param PARAM_LINEAR_LIMIT_SOFTNESS = 2
A factor applied to the movement across the axes. The lower, the slower the movement.
Param PARAM_LINEAR_RESTITUTION = 3
The amount of restitution on the axes' movement. The lower, the more momentum gets lost.
Param PARAM_LINEAR_DAMPING = 4
The amount of damping that happens at the linear motion across the axes.
Param PARAM_LINEAR_MOTOR_TARGET_VELOCITY = 5
The velocity the linear motor will try to reach.
Param PARAM_LINEAR_MOTOR_FORCE_LIMIT = 6
The maximum force the linear motor will apply while trying to reach the velocity target.
Param PARAM_LINEAR_SPRING_STIFFNESS = 7
Param PARAM_LINEAR_SPRING_DAMPING = 8
Param PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT = 9
Param PARAM_ANGULAR_LOWER_LIMIT = 10
The minimum rotation in negative direction to break loose and rotate around the axes.
Param PARAM_ANGULAR_UPPER_LIMIT = 11
The minimum rotation in positive direction to break loose and rotate around the axes.
Param PARAM_ANGULAR_LIMIT_SOFTNESS = 12
The speed of all rotations across the axes.
Param PARAM_ANGULAR_DAMPING = 13
The amount of rotational damping across the axes. The lower, the more damping occurs.
Param PARAM_ANGULAR_RESTITUTION = 14
The amount of rotational restitution across the axes. The lower, the more restitution occurs.
Param PARAM_ANGULAR_FORCE_LIMIT = 15
The maximum amount of force that can occur, when rotating around the axes.
Param PARAM_ANGULAR_ERP = 16
When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
Param PARAM_ANGULAR_MOTOR_TARGET_VELOCITY = 17
Target speed for the motor at the axes.
Param PARAM_ANGULAR_MOTOR_FORCE_LIMIT = 18
Maximum acceleration for the motor at the axes.
Param PARAM_ANGULAR_SPRING_STIFFNESS = 19
Param PARAM_ANGULAR_SPRING_DAMPING = 20
Param PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT = 21
Param PARAM_MAX = 22
Represents the size of the Param enum.
enum Flag:
Flag FLAG_ENABLE_LINEAR_LIMIT = 0
If enabled, linear motion is possible within the given limits.
Flag FLAG_ENABLE_ANGULAR_LIMIT = 1
If enabled, rotational motion is possible within the given limits.
Flag FLAG_ENABLE_LINEAR_SPRING = 3
Flag FLAG_ENABLE_ANGULAR_SPRING = 2
Flag FLAG_ENABLE_MOTOR = 4
If enabled, there is a rotational motor across these axes.
Flag FLAG_ENABLE_LINEAR_MOTOR = 5
If enabled, there is a linear motor across these axes.
Flag FLAG_MAX = 6
Represents the size of the Flag enum.
Property Descriptions¶
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.
bool angular_limit_x/enabled = true
If true
, rotation across the X axis is limited.
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.
float angular_limit_x/force_limit = 0.0
The maximum amount of force that can occur, when rotating around the X axis.
float angular_limit_x/lower_angle = 0.0
The minimum rotation in negative direction to break loose and rotate around the X axis.
float angular_limit_x/restitution = 0.0
The amount of rotational restitution across the X axis. The lower, the more restitution occurs.
float angular_limit_x/softness = 0.5
The speed of all rotations across the X axis.
float angular_limit_x/upper_angle = 0.0
void set_param_x ( Param param,