diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 14:29:06 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch) | |
tree | 43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/3d/physics_joint_3d.cpp | |
parent | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff) | |
download | redot-engine-07bc4e2f96f8f47991339654ff4ab16acc19d44f.tar.gz |
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
-o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
-o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```
This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.
This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.
Part of #33027.
Diffstat (limited to 'scene/3d/physics_joint_3d.cpp')
-rw-r--r-- | scene/3d/physics_joint_3d.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/3d/physics_joint_3d.cpp b/scene/3d/physics_joint_3d.cpp index d1a26f33bf..99d0473d9b 100644 --- a/scene/3d/physics_joint_3d.cpp +++ b/scene/3d/physics_joint_3d.cpp @@ -88,6 +88,7 @@ void Joint3D::set_node_b(const NodePath &p_node_b) { b = p_node_b; _update_joint(); } + NodePath Joint3D::get_node_b() const { return b; } @@ -173,6 +174,7 @@ void PinJoint3D::set_param(Param p_param, float p_value) { if (get_joint().is_valid()) PhysicsServer3D::get_singleton()->pin_joint_set_param(get_joint(), PhysicsServer3D::PinJointParam(p_param), p_value); } + float PinJoint3D::get_param(Param p_param) const { ERR_FAIL_INDEX_V(p_param, 3, 0); return params[p_param]; @@ -270,6 +272,7 @@ void HingeJoint3D::set_param(Param p_param, float p_value) { update_gizmo(); } + float HingeJoint3D::get_param(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params[p_param]; @@ -283,6 +286,7 @@ void HingeJoint3D::set_flag(Flag p_flag, bool p_value) { update_gizmo(); } + bool HingeJoint3D::get_flag(Flag p_flag) const { ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false); return flags[p_flag]; @@ -416,6 +420,7 @@ void SliderJoint3D::set_param(Param p_param, float p_value) { PhysicsServer3D::get_singleton()->slider_joint_set_param(get_joint(), PhysicsServer3D::SliderJointParam(p_param), p_value); update_gizmo(); } + float SliderJoint3D::get_param(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params[p_param]; @@ -521,6 +526,7 @@ void ConeTwistJoint3D::set_param(Param p_param, float p_value) { update_gizmo(); } + float ConeTwistJoint3D::get_param(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params[p_param]; @@ -781,6 +787,7 @@ void Generic6DOFJoint3D::set_param_x(Param p_param, float p_value) { update_gizmo(); } + float Generic6DOFJoint3D::get_param_x(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params_x[p_param]; @@ -793,6 +800,7 @@ void Generic6DOFJoint3D::set_param_y(Param p_param, float p_value) { PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisParam(p_param), p_value); update_gizmo(); } + float Generic6DOFJoint3D::get_param_y(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params_y[p_param]; @@ -805,6 +813,7 @@ void Generic6DOFJoint3D::set_param_z(Param p_param, float p_value) { PhysicsServer3D::get_singleton()->generic_6dof_joint_set_param(get_joint(), Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisParam(p_param), p_value); update_gizmo(); } + float Generic6DOFJoint3D::get_param_z(Param p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); return params_z[p_param]; @@ -817,6 +826,7 @@ void Generic6DOFJoint3D::set_flag_x(Flag p_flag, bool p_enabled) { PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_X, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled); update_gizmo(); } + bool Generic6DOFJoint3D::get_flag_x(Flag p_flag) const { ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false); return flags_x[p_flag]; @@ -829,6 +839,7 @@ void Generic6DOFJoint3D::set_flag_y(Flag p_flag, bool p_enabled) { PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Y, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled); update_gizmo(); } + bool Generic6DOFJoint3D::get_flag_y(Flag p_flag) const { ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false); return flags_y[p_flag]; @@ -841,6 +852,7 @@ void Generic6DOFJoint3D::set_flag_z(Flag p_flag, bool p_enabled) { PhysicsServer3D::get_singleton()->generic_6dof_joint_set_flag(get_joint(), Vector3::AXIS_Z, PhysicsServer3D::G6DOFJointAxisFlag(p_flag), p_enabled); update_gizmo(); } + bool Generic6DOFJoint3D::get_flag_z(Flag p_flag) const { ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false); return flags_z[p_flag]; |