Skip to content

Commit

Permalink
Generic6DOFJoint3D: Rename FLAG_ENABLE_MOTOR to FLAG_ENABLE_ANGULAR_M…
Browse files Browse the repository at this point in the history
…OTOR
  • Loading branch information
aaronfranke committed Oct 30, 2024
1 parent 8004c75 commit f2adb2c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 14 deletions.
7 changes: 5 additions & 2 deletions doc/classes/Generic6DOFJoint3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,11 @@
</constant>
<constant name="FLAG_ENABLE_ANGULAR_SPRING" value="2" enum="Flag">
</constant>
<constant name="FLAG_ENABLE_MOTOR" value="4" enum="Flag">
If enabled, there is a rotational motor across these axes.
<constant name="FLAG_ENABLE_ANGULAR_MOTOR" value="4" enum="Flag">
If enabled, there is a rotational or angular motor across these axes.
</constant>
<constant name="FLAG_ENABLE_MOTOR" value="4" enum="Flag" deprecated="Use [constant FLAG_ENABLE_ANGULAR_MOTOR] instead.">
If enabled, there is a rotational or angular motor across these axes.
</constant>
<constant name="FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="Flag">
If enabled, there is a linear motor across these axes.
Expand Down
7 changes: 5 additions & 2 deletions doc/classes/PhysicsServer3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1585,8 +1585,11 @@
</constant>
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING" value="3" enum="G6DOFJointAxisFlag">
</constant>
<constant name="G6DOF_JOINT_FLAG_ENABLE_MOTOR" value="4" enum="G6DOFJointAxisFlag">
If set, there is a rotational motor across these axes.
<constant name="G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR" value="4" enum="G6DOFJointAxisFlag">
If set, there is a rotational or angular motor across these axes.
</constant>
<constant name="G6DOF_JOINT_FLAG_ENABLE_MOTOR" value="4" enum="G6DOFJointAxisFlag" deprecated="Use [constant G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR] instead.">
If set, there is a rotational or angular motor across these axes.
</constant>
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="G6DOFJointAxisFlag">
If set, there is a linear motor on this axis that targets a specific velocity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ void GodotGeneric6DOFJoint3D::set_flag(Vector3::Axis p_axis, PhysicsServer3D::G6
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
m_angularLimits[p_axis].m_enableLimit = p_value;
} break;
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR: {
m_angularLimits[p_axis].m_enableMotor = p_value;
} break;
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
Expand All @@ -655,7 +655,7 @@ bool GodotGeneric6DOFJoint3D::get_flag(Vector3::Axis p_axis, PhysicsServer3D::G6
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: {
return m_angularLimits[p_axis].m_enableLimit;
} break;
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR: {
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR: {
return m_angularLimits[p_axis].m_enableMotor;
} break;
case PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: {
Expand Down
13 changes: 7 additions & 6 deletions scene/3d/physics/joints/generic_6dof_joint_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ void Generic6DOFJoint3D::_bind_methods() {

ADD_GROUP("Angular Motor", "angular_motor_");

ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_ANGULAR_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_x/target_velocity", PROPERTY_HINT_NONE, U"radians_as_degrees,suffix:\u00B0/s"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_x/force_limit", PROPERTY_HINT_NONE, U"suffix:kg\u22C5m\u00B2/s\u00B2 (Nm)"), "set_param_x", "get_param_x", PARAM_ANGULAR_MOTOR_FORCE_LIMIT);

ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_ANGULAR_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_y/target_velocity", PROPERTY_HINT_NONE, U"radians_as_degrees,suffix:\u00B0/s"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_y/force_limit", PROPERTY_HINT_NONE, U"suffix:kg\u22C5m\u00B2/s\u00B2 (Nm)"), "set_param_y", "get_param_y", PARAM_ANGULAR_MOTOR_FORCE_LIMIT);

ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_motor_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_ANGULAR_MOTOR);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_z/target_velocity", PROPERTY_HINT_NONE, U"radians_as_degrees,suffix:\u00B0/s"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_TARGET_VELOCITY);
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angular_motor_z/force_limit", PROPERTY_HINT_NONE, U"suffix:kg\u22C5m\u00B2/s\u00B2 (Nm)"), "set_param_z", "get_param_z", PARAM_ANGULAR_MOTOR_FORCE_LIMIT);

Expand Down Expand Up @@ -191,6 +191,7 @@ void Generic6DOFJoint3D::_bind_methods() {
BIND_ENUM_CONSTANT(FLAG_ENABLE_ANGULAR_LIMIT);
BIND_ENUM_CONSTANT(FLAG_ENABLE_LINEAR_SPRING);
BIND_ENUM_CONSTANT(FLAG_ENABLE_ANGULAR_SPRING);
BIND_ENUM_CONSTANT(FLAG_ENABLE_ANGULAR_MOTOR);
BIND_ENUM_CONSTANT(FLAG_ENABLE_MOTOR);
BIND_ENUM_CONSTANT(FLAG_ENABLE_LINEAR_MOTOR);
BIND_ENUM_CONSTANT(FLAG_MAX);
Expand Down Expand Up @@ -340,7 +341,7 @@ Generic6DOFJoint3D::Generic6DOFJoint3D() {
set_flag_x(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_x(FLAG_ENABLE_ANGULAR_SPRING, false);
set_flag_x(FLAG_ENABLE_LINEAR_SPRING, false);
set_flag_x(FLAG_ENABLE_MOTOR, false);
set_flag_x(FLAG_ENABLE_ANGULAR_MOTOR, false);
set_flag_x(FLAG_ENABLE_LINEAR_MOTOR, false);

set_param_y(PARAM_LINEAR_LOWER_LIMIT, 0);
Expand Down Expand Up @@ -370,7 +371,7 @@ Generic6DOFJoint3D::Generic6DOFJoint3D() {
set_flag_y(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_y(FLAG_ENABLE_ANGULAR_SPRING, false);
set_flag_y(FLAG_ENABLE_LINEAR_SPRING, false);
set_flag_y(FLAG_ENABLE_MOTOR, false);
set_flag_y(FLAG_ENABLE_ANGULAR_MOTOR, false);
set_flag_y(FLAG_ENABLE_LINEAR_MOTOR, false);

set_param_z(PARAM_LINEAR_LOWER_LIMIT, 0);
Expand Down Expand Up @@ -400,6 +401,6 @@ Generic6DOFJoint3D::Generic6DOFJoint3D() {
set_flag_z(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_z(FLAG_ENABLE_ANGULAR_SPRING, false);
set_flag_z(FLAG_ENABLE_LINEAR_SPRING, false);
set_flag_z(FLAG_ENABLE_MOTOR, false);
set_flag_z(FLAG_ENABLE_ANGULAR_MOTOR, false);
set_flag_z(FLAG_ENABLE_LINEAR_MOTOR, false);
}
3 changes: 2 additions & 1 deletion scene/3d/physics/joints/generic_6dof_joint_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ class Generic6DOFJoint3D : public Joint3D {
FLAG_ENABLE_ANGULAR_LIMIT = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
FLAG_ENABLE_LINEAR_SPRING = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING,
FLAG_ENABLE_ANGULAR_SPRING = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING,
FLAG_ENABLE_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_MOTOR,
FLAG_ENABLE_ANGULAR_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR,
FLAG_ENABLE_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR,
FLAG_ENABLE_LINEAR_MOTOR = PhysicsServer3D::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
FLAG_MAX = PhysicsServer3D::G6DOF_JOINT_FLAG_MAX
};
Expand Down
1 change: 1 addition & 0 deletions servers/physics_server_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ void PhysicsServer3D::_bind_methods() {
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_MOTOR);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_MAX);
Expand Down
3 changes: 2 additions & 1 deletion servers/physics_server_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,8 @@ class PhysicsServer3D : public Object {
G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING,
G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING,
G6DOF_JOINT_FLAG_ENABLE_MOTOR,
G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR,
G6DOF_JOINT_FLAG_ENABLE_MOTOR = G6DOF_JOINT_FLAG_ENABLE_ANGULAR_MOTOR,
G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
G6DOF_JOINT_FLAG_MAX
};
Expand Down

0 comments on commit f2adb2c

Please sign in to comment.