Skip to content

Commit df6f4ce

Browse files
committed
Merge pull request godotengine#89851 from rburing/bind_6dof_enums
Bind constants related to 6DOF joints
2 parents d28fb26 + 38a31f4 commit df6f4ce

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

doc/classes/PhysicsServer3D.xml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@
740740
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
741741
<param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" />
742742
<description>
743-
Gets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants).
743+
Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags.
744744
</description>
745745
</method>
746746
<method name="generic_6dof_joint_get_param" qualifiers="const">
@@ -749,7 +749,7 @@
749749
<param index="1" name="axis" type="int" enum="Vector3.Axis" />
750750
<param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" />
751751
<description>
752-
Gets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants).
752+
Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters.
753753
</description>
754754
</method>
755755
<method name="generic_6dof_joint_set_flag">
@@ -759,7 +759,7 @@
759759
<param index="2" name="flag" type="int" enum="PhysicsServer3D.G6DOFJointAxisFlag" />
760760
<param index="3" name="enable" type="bool" />
761761
<description>
762-
Sets a generic_6_DOF_joint flag (see [enum G6DOFJointAxisFlag] constants).
762+
Sets the value of a given generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags.
763763
</description>
764764
</method>
765765
<method name="generic_6dof_joint_set_param">
@@ -769,7 +769,7 @@
769769
<param index="2" name="param" type="int" enum="PhysicsServer3D.G6DOFJointAxisParam" />
770770
<param index="3" name="value" type="float" />
771771
<description>
772-
Sets a generic_6_DOF_joint parameter (see [enum G6DOFJointAxisParam] constants).
772+
Sets the value of a given generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters.
773773
</description>
774774
</method>
775775
<method name="get_process_info">
@@ -876,6 +876,7 @@
876876
<param index="3" name="body_B" type="RID" />
877877
<param index="4" name="local_ref_B" type="Transform3D" />
878878
<description>
879+
Make the joint a generic six degrees of freedom (6DOF) joint. Use [method generic_6dof_joint_set_flag] and [method generic_6dof_joint_set_param] to set the joint's flags and parameters respectively.
879880
</description>
880881
</method>
881882
<method name="joint_make_hinge">
@@ -1497,6 +1498,12 @@
14971498
<constant name="G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT" value="6" enum="G6DOFJointAxisParam">
14981499
The maximum force that the linear motor can apply while trying to reach the target velocity.
14991500
</constant>
1501+
<constant name="G6DOF_JOINT_LINEAR_SPRING_STIFFNESS" value="7" enum="G6DOFJointAxisParam">
1502+
</constant>
1503+
<constant name="G6DOF_JOINT_LINEAR_SPRING_DAMPING" value="8" enum="G6DOFJointAxisParam">
1504+
</constant>
1505+
<constant name="G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT" value="9" enum="G6DOFJointAxisParam">
1506+
</constant>
15001507
<constant name="G6DOF_JOINT_ANGULAR_LOWER_LIMIT" value="10" enum="G6DOFJointAxisParam">
15011508
The minimum rotation in negative direction to break loose and rotate around the axes.
15021509
</constant>
@@ -1524,18 +1531,34 @@
15241531
<constant name="G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT" value="18" enum="G6DOFJointAxisParam">
15251532
Maximum acceleration for the motor at the axes.
15261533
</constant>
1534+
<constant name="G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS" value="19" enum="G6DOFJointAxisParam">
1535+
</constant>
1536+
<constant name="G6DOF_JOINT_ANGULAR_SPRING_DAMPING" value="20" enum="G6DOFJointAxisParam">
1537+
</constant>
1538+
<constant name="G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT" value="21" enum="G6DOFJointAxisParam">
1539+
</constant>
1540+
<constant name="G6DOF_JOINT_MAX" value="22" enum="G6DOFJointAxisParam">
1541+
Represents the size of the [enum G6DOFJointAxisParam] enum.
1542+
</constant>
15271543
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT" value="0" enum="G6DOFJointAxisFlag">
15281544
If set, linear motion is possible within the given limits.
15291545
</constant>
15301546
<constant name="G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT" value="1" enum="G6DOFJointAxisFlag">
15311547
If set, rotational motion is possible.
15321548
</constant>
1549+
<constant name="G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING" value="2" enum="G6DOFJointAxisFlag">
1550+
</constant>
1551+
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING" value="3" enum="G6DOFJointAxisFlag">
1552+
</constant>
15331553
<constant name="G6DOF_JOINT_FLAG_ENABLE_MOTOR" value="4" enum="G6DOFJointAxisFlag">
15341554
If set, there is a rotational motor across these axes.
15351555
</constant>
15361556
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR" value="5" enum="G6DOFJointAxisFlag">
15371557
If set, there is a linear motor on this axis that targets a specific velocity.
15381558
</constant>
1559+
<constant name="G6DOF_JOINT_FLAG_MAX" value="6" enum="G6DOFJointAxisFlag">
1560+
Represents the size of the [enum G6DOFJointAxisFlag] enum.
1561+
</constant>
15391562
<constant name="SHAPE_WORLD_BOUNDARY" value="0" enum="ShapeType">
15401563
The [Shape3D] is a [WorldBoundaryShape3D].
15411564
</constant>

servers/physics_server_3d.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,9 @@ void PhysicsServer3D::_bind_methods() {
985985
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_DAMPING);
986986
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY);
987987
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT);
988+
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_SPRING_STIFFNESS);
989+
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_SPRING_DAMPING);
990+
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT);
988991
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_LOWER_LIMIT);
989992
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_UPPER_LIMIT);
990993
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS);
@@ -994,11 +997,18 @@ void PhysicsServer3D::_bind_methods() {
994997
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_ERP);
995998
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY);
996999
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT);
1000+
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS);
1001+
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_SPRING_DAMPING);
1002+
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT);
1003+
BIND_ENUM_CONSTANT(G6DOF_JOINT_MAX);
9971004

9981005
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT);
9991006
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT);
1007+
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING);
1008+
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING);
10001009
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_MOTOR);
10011010
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR);
1011+
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_MAX);
10021012

10031013
ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &PhysicsServer3D::joint_get_type);
10041014

0 commit comments

Comments
 (0)