diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp
index 5f5d8a766a96..d1e3d2f6ea3f 100644
--- a/core/math/transform_2d.cpp
+++ b/core/math/transform_2d.cpp
@@ -158,9 +158,9 @@ bool Transform2D::is_equal_approx(const Transform2D &p_transform) const {
return elements[0].is_equal_approx(p_transform.elements[0]) && elements[1].is_equal_approx(p_transform.elements[1]) && elements[2].is_equal_approx(p_transform.elements[2]);
}
-Transform2D Transform2D::looking_at(const Vector2 target) const {
+Transform2D Transform2D::looking_at(const Vector2 p_target) const {
Transform2D return_trans = Transform2D(get_rotation(), get_origin());
- Vector2 target_position = affine_inverse().xform(target);
+ Vector2 target_position = affine_inverse().xform(p_target);
return_trans.set_rotation(return_trans.get_rotation() + (target_position * get_scale()).angle());
return return_trans;
}
diff --git a/core/math/transform_2d.h b/core/math/transform_2d.h
index cf803b0e9d5f..8663c30db5ce 100644
--- a/core/math/transform_2d.h
+++ b/core/math/transform_2d.h
@@ -100,7 +100,7 @@ struct Transform2D {
Transform2D orthonormalized() const;
bool is_equal_approx(const Transform2D &p_transform) const;
- Transform2D looking_at(const Vector2 target) const;
+ Transform2D looking_at(const Vector2 p_target) const;
bool operator==(const Transform2D &p_transform) const;
bool operator!=(const Transform2D &p_transform) const;
diff --git a/doc/classes/Bone2D.xml b/doc/classes/Bone2D.xml
index bc393f5ad0e9..88f7c55e614f 100644
--- a/doc/classes/Bone2D.xml
+++ b/doc/classes/Bone2D.xml
@@ -23,7 +23,7 @@
- Returns whether this [code]Bone2D[/code] node is going to autocalculate it's length and bone angle using its first [code]Bone2D[/code] child node, if one exists. If there are no [code]Bone2D[/code] children, then it cannot autocalculate these values and will print a warning.
+ Returns whether this [code]Bone2D[/code] node is going to autocalculate its length and bone angle using its first [code]Bone2D[/code] child node, if one exists. If there are no [code]Bone2D[/code] children, then it cannot autocalculate these values and will print a warning.
@@ -31,14 +31,7 @@
Returns the angle of the bone in the [code]Bone2D[/code] node.
- [b]Note[/b]: This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
-
-
-
-
-
-
- [i]Deprecated soon.[/i] Please use [code]get_length[/code] instead.
+ [b]Note:[/b] This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
@@ -78,16 +71,7 @@
Sets the bone angle for the [code]Bone2D[/code] node. This is typically set to the rotation from the [code]Bone2D[/code] node to a child [code]Bone2D[/code] node.
- [b]Note[/b]: This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
-
-
-
-
-
-
-
-
- [i]Deprecated soon.[/i] Please use [code]set_length[/code] instead.
+ [b]Note:[/b] This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
diff --git a/doc/classes/PhysicalBone2D.xml b/doc/classes/PhysicalBone2D.xml
index f3f32ac4f00e..cea75bad52e7 100644
--- a/doc/classes/PhysicalBone2D.xml
+++ b/doc/classes/PhysicalBone2D.xml
@@ -5,8 +5,8 @@
The [code]PhysicalBone2D[/code] node is a [RigidBody2D]-based node that can be used to make [Bone2D] nodes in a [Skeleton2D] react to physics. This node is very similar to the [PhysicalBone3D] node, just for 2D instead of 3D.
- [b]Note[/b]: To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
- [b]Note[/b]: The PhysicalBone2D node does not automatically create a [Joint2D] node to keep [code]PhysicalBone2D[/code] nodes together. You will need to create these manually. For most cases, you want to use a [PinJoint2D] node. The [code]PhysicalBone2D[/code] node can automatically configure the [Joint2D] node once it's been created as a child node.
+ [b]Note:[/b] To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
+ [b]Note:[/b] The PhysicalBone2D node does not automatically create a [Joint2D] node to keep [code]PhysicalBone2D[/code] nodes together. You will need to create these manually. For most cases, you want to use a [PinJoint2D] node. The [code]PhysicalBone2D[/code] node can automatically configure the [Joint2D] node once it's been created as a child node.
@@ -28,7 +28,7 @@
- When true, the [code]PhysicalBone2D[/code] node will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D].
+ If [code]true[/code], the [code]PhysicalBone2D[/code] node will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D].
The index of the [Bone2D] node that this [code]PhysicalBone2D[/code] node is supposed to be simulating.
@@ -37,11 +37,11 @@
The [NodePath] to the [Bone2D] node that this [code]PhysicalBone2D[/code] node is supposed to be simulating.
- When [code]true[/code], the [code]PhysicalBone2D[/code] will keep the transform of the bone it is bound to when simulating physics.
+ If [code]true[/code], the [code]PhysicalBone2D[/code] will keep the transform of the bone it is bound to when simulating physics.
- When [code]true[/code], the [code]PhysicalBone2D[/code] will start simulating using physics. When false, the [code]PhysicalBone2D[/code] will follow the transform of the [Bone2D] node.
- [b]Note[/b]: To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
+ If [code]true[/code], the [code]PhysicalBone2D[/code] will start simulating using physics. If [code]false[/code], the [code]PhysicalBone2D[/code] will follow the transform of the [Bone2D] node.
+ [b]Note:[/b] To have the Bone2D nodes visually follow the [code]PhysicalBone2D[/code] node, use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes.
diff --git a/doc/classes/SkeletonModification2D.xml b/doc/classes/SkeletonModification2D.xml
index a27662846d78..cfbc2414ea3b 100644
--- a/doc/classes/SkeletonModification2D.xml
+++ b/doc/classes/SkeletonModification2D.xml
@@ -30,7 +30,7 @@
Used for drawing [b]editor-only[/b] modification gizmos. This function will only be called in the Godot editor and can be overriden to draw custom gizmos.
- [b]Note[/b]: You will need to use the Skeleton2D from [method SkeletonModificationStack2D.get_skeleton] and it's draw functions, as the [SkeletonModification2D] resource cannot draw on its own.
+ [b]Note:[/b] You will need to use the Skeleton2D from [method SkeletonModificationStack2D.get_skeleton] and it's draw functions, as the [SkeletonModification2D] resource cannot draw on its own.
@@ -92,7 +92,7 @@
- When true, the modification's [method execute] function will be called by the [SkeletonModificationStack2D].
+ If [code]true[/code], the modification's [method execute] function will be called by the [SkeletonModificationStack2D].
The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only availible in certain execution modes.
diff --git a/doc/classes/SkeletonModification2DJiggle.xml b/doc/classes/SkeletonModification2DJiggle.xml
index 15ba2e4b8e0a..2233fbff53d4 100644
--- a/doc/classes/SkeletonModification2DJiggle.xml
+++ b/doc/classes/SkeletonModification2DJiggle.xml
@@ -200,7 +200,7 @@
- When [code]true[/code], the Jiggle modifier will take colliders into account, keeping them from entering into these collision objects.
+ If [code]true[/code], the Jiggle modifier will take colliders into account, keeping them from entering into these collision objects.
diff --git a/doc/classes/SkeletonModification2DTwoBoneIK.xml b/doc/classes/SkeletonModification2DTwoBoneIK.xml
index 10a122e9b4e9..554515556b1c 100644
--- a/doc/classes/SkeletonModification2DTwoBoneIK.xml
+++ b/doc/classes/SkeletonModification2DTwoBoneIK.xml
@@ -77,7 +77,7 @@
- When [code]true[/code], the bones in the modification will blend outward as opposed to inwards when contracting. When [code]false[/code], the bones will bend inwards when contracting.
+ If [code]true[/code], the bones in the modification will blend outward as opposed to inwards when contracting. If [code]false[/code], the bones will bend inwards when contracting.
The maximum distance the target can be at. If the target is farther than this distance, the modification will solve as if it's at this maximum distance. When set to [code]0[/code], the modification will solve without distance constraints.
diff --git a/doc/classes/SkeletonModificationStack2D.xml b/doc/classes/SkeletonModificationStack2D.xml
index 55822a84e7f6..35b899fe08a9 100644
--- a/doc/classes/SkeletonModificationStack2D.xml
+++ b/doc/classes/SkeletonModificationStack2D.xml
@@ -94,7 +94,7 @@
- When [code]true[/code], the modification's in the stack will be called. This is handled automatically through the [Skeleton2D] node.
+ If [code]true[/code], the modification's in the stack will be called. This is handled automatically through the [Skeleton2D] node.
The number of modifications in the stack.
diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp
index dd52fe3c1633..ecbb6654c839 100644
--- a/scene/2d/skeleton_2d.cpp
+++ b/scene/2d/skeleton_2d.cpp
@@ -46,6 +46,8 @@ bool Bone2D::_set(const StringName &p_path, const Variant &p_value) {
set_length(p_value);
} else if (path.begins_with("bone_angle")) {
set_bone_angle(Math::deg2rad(float(p_value)));
+ } else if (path.begins_with("default_length")) {
+ set_length(p_value);
}
#ifdef TOOLS_ENABLED
@@ -66,6 +68,8 @@ bool Bone2D::_get(const StringName &p_path, Variant &r_ret) const {
r_ret = get_length();
} else if (path.begins_with("bone_angle")) {
r_ret = Math::rad2deg(get_bone_angle());
+ } else if (path.begins_with("default_length")) {
+ r_ret = get_length();
}
#ifdef TOOLS_ENABLED
diff --git a/scene/main/node.h b/scene/main/node.h
index abe364c601df..de7953e4bc5b 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -256,8 +256,7 @@ class Node : public Object {
// Editor specific node notifications
NOTIFICATION_EDITOR_PRE_SAVE = 9001,
- NOTIFICATION_EDITOR_POST_SAVE = 9002
-
+ NOTIFICATION_EDITOR_POST_SAVE = 9002,
};
/* NODE/TREE */
diff --git a/scene/resources/skeleton_modification_2d.cpp b/scene/resources/skeleton_modification_2d.cpp
index cdc2ddc6b119..d2dabf4e6055 100644
--- a/scene/resources/skeleton_modification_2d.cpp
+++ b/scene/resources/skeleton_modification_2d.cpp
@@ -43,11 +43,12 @@
// Modification2D
///////////////////////////////////////
-void SkeletonModification2D::_execute(float delta) {
- call("_execute", delta);
+void SkeletonModification2D::_execute(float p_delta) {
+ call("_execute", p_delta);
- if (!enabled)
+ if (!enabled) {
return;
+ }
}
void SkeletonModification2D::_setup_modification(SkeletonModificationStack2D *p_stack) {
@@ -81,52 +82,52 @@ bool SkeletonModification2D::get_enabled() {
return enabled;
}
-float SkeletonModification2D::clamp_angle(float angle, float min_bound, float max_bound, bool invert) {
+float SkeletonModification2D::clamp_angle(float p_angle, float p_min_bound, float p_max_bound, bool p_invert) {
// Map to the 0 to 360 range (in radians though) instead of the -180 to 180 range.
- if (angle < 0) {
- angle = Math_TAU + angle;
+ if (p_angle < 0) {
+ p_angle = Math_TAU + p_angle;
}
// Make min and max in the range of 0 to 360 (in radians), and make sure they are in the right order
- if (min_bound < 0) {
- min_bound = Math_TAU + min_bound;
+ if (p_min_bound < 0) {
+ p_min_bound = Math_TAU + p_min_bound;
}
- if (max_bound < 0) {
- max_bound = Math_TAU + max_bound;
+ if (p_max_bound < 0) {
+ p_max_bound = Math_TAU + p_max_bound;
}
- if (min_bound > max_bound) {
- float tmp = min_bound;
- min_bound = max_bound;
- max_bound = tmp;
+ if (p_min_bound > p_max_bound) {
+ float tmp = p_min_bound;
+ p_min_bound = p_max_bound;
+ p_max_bound = tmp;
}
// Note: May not be the most optimal way to clamp, but it always constraints to the nearest angle.
- if (invert == false) {
- if (angle < min_bound || angle > max_bound) {
- Vector2 min_bound_vec = Vector2(Math::cos(min_bound), Math::sin(min_bound));
- Vector2 max_bound_vec = Vector2(Math::cos(max_bound), Math::sin(max_bound));
- Vector2 angle_vec = Vector2(Math::cos(angle), Math::sin(angle));
+ if (p_invert == false) {
+ if (p_angle < p_min_bound || p_angle > p_max_bound) {
+ Vector2 min_bound_vec = Vector2(Math::cos(p_min_bound), Math::sin(p_min_bound));
+ Vector2 max_bound_vec = Vector2(Math::cos(p_max_bound), Math::sin(p_max_bound));
+ Vector2 angle_vec = Vector2(Math::cos(p_angle), Math::sin(p_angle));
if (angle_vec.distance_squared_to(min_bound_vec) <= angle_vec.distance_squared_to(max_bound_vec)) {
- angle = min_bound;
+ p_angle = p_min_bound;
} else {
- angle = max_bound;
+ p_angle = p_max_bound;
}
}
} else {
- if (angle > min_bound && angle < max_bound) {
- Vector2 min_bound_vec = Vector2(Math::cos(min_bound), Math::sin(min_bound));
- Vector2 max_bound_vec = Vector2(Math::cos(max_bound), Math::sin(max_bound));
- Vector2 angle_vec = Vector2(Math::cos(angle), Math::sin(angle));
+ if (p_angle > p_min_bound && p_angle < p_max_bound) {
+ Vector2 min_bound_vec = Vector2(Math::cos(p_min_bound), Math::sin(p_min_bound));
+ Vector2 max_bound_vec = Vector2(Math::cos(p_max_bound), Math::sin(p_max_bound));
+ Vector2 angle_vec = Vector2(Math::cos(p_angle), Math::sin(p_angle));
if (angle_vec.distance_squared_to(min_bound_vec) <= angle_vec.distance_squared_to(max_bound_vec)) {
- angle = min_bound;
+ p_angle = p_min_bound;
} else {
- angle = max_bound;
+ p_angle = p_max_bound;
}
}
}
- return angle;
+ return p_angle;
}
void SkeletonModification2D::editor_draw_angle_constraints(Bone2D *operation_bone, float min_bound, float max_bound,
diff --git a/scene/resources/skeleton_modification_2d.h b/scene/resources/skeleton_modification_2d.h
index 7fcf7576936f..18633e55cba9 100644
--- a/scene/resources/skeleton_modification_2d.h
+++ b/scene/resources/skeleton_modification_2d.h
@@ -58,7 +58,7 @@ class SkeletonModification2D : public Resource {
bool _print_execution_error(bool p_condition, String p_message);
public:
- virtual void _execute(float delta);
+ virtual void _execute(float _delta);
virtual void _setup_modification(SkeletonModificationStack2D *p_stack);
virtual void _draw_editor_gizmo();
@@ -76,8 +76,8 @@ class SkeletonModification2D : public Resource {
void set_execution_mode(int p_mode);
int get_execution_mode() const;
- float clamp_angle(float angle, float min_bound, float max_bound, bool invert_clamp = false);
- void editor_draw_angle_constraints(Bone2D *operation_bone, float min_bound, float max_bound, bool constraint_enabled, bool constraint_in_localspace, bool constraint_inverted);
+ float clamp_angle(float p_angle, float p_min_bound, float p_max_bound, bool p_invert_clamp = false);
+ void editor_draw_angle_constraints(Bone2D *p_operation_bone, float p_min_bound, float p_max_bound, bool p_constraint_enabled, bool p_constraint_in_localspace, bool p_constraint_inverted);
SkeletonModification2D();
};
diff --git a/scene/resources/skeleton_modification_2d_ccdik.cpp b/scene/resources/skeleton_modification_2d_ccdik.cpp
index 16501ea298f2..7ea60e584ea3 100644
--- a/scene/resources/skeleton_modification_2d_ccdik.cpp
+++ b/scene/resources/skeleton_modification_2d_ccdik.cpp
@@ -153,7 +153,7 @@ void SkeletonModification2DCCDIK::_get_property_list(List *p_list)
#endif // TOOLS_ENABLED
}
-void SkeletonModification2DCCDIK::_execute(float delta) {
+void SkeletonModification2DCCDIK::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
@@ -188,7 +188,7 @@ void SkeletonModification2DCCDIK::_execute(float delta) {
}
}
-void SkeletonModification2DCCDIK::_execute_ccdik_joint(int p_joint_idx, Node2D *target, Node2D *tip) {
+void SkeletonModification2DCCDIK::_execute_ccdik_joint(int p_joint_idx, Node2D *p_target, Node2D *p_tip) {
CCDIK_Joint_Data2D ccdik_data = ccdik_data_chain[p_joint_idx];
if (ccdik_data.bone_idx < 0 || ccdik_data.bone_idx > stack->skeleton->get_bone_count()) {
ERR_PRINT_ONCE("2D CCDIK joint: bone index not found!");
@@ -201,12 +201,12 @@ void SkeletonModification2DCCDIK::_execute_ccdik_joint(int p_joint_idx, Node2D *
if (ccdik_data.rotate_from_joint) {
// To rotate from the joint, simply look at the target!
operation_transform.set_rotation(
- operation_transform.looking_at(target->get_global_transform().get_origin()).get_rotation() - operation_bone->get_bone_angle());
+ operation_transform.looking_at(p_target->get_global_transform().get_origin()).get_rotation() - operation_bone->get_bone_angle());
} else {
// How to rotate from the tip: get the difference of rotation needed from the tip to the target, from the perspective of the joint.
// Because we are only using the offset, we do not need to account for the bone angle of the Bone2D node.
- float joint_to_tip = operation_transform.get_origin().angle_to_point(tip->get_global_transform().get_origin());
- float joint_to_target = operation_transform.get_origin().angle_to_point(target->get_global_transform().get_origin());
+ float joint_to_tip = operation_transform.get_origin().angle_to_point(p_tip->get_global_transform().get_origin());
+ float joint_to_target = operation_transform.get_origin().angle_to_point(p_target->get_global_transform().get_origin());
operation_transform.set_rotation(
operation_transform.get_rotation() + (joint_to_target - joint_to_tip));
}
diff --git a/scene/resources/skeleton_modification_2d_ccdik.h b/scene/resources/skeleton_modification_2d_ccdik.h
index aba6773bf761..dc48291f6254 100644
--- a/scene/resources/skeleton_modification_2d_ccdik.h
+++ b/scene/resources/skeleton_modification_2d_ccdik.h
@@ -68,7 +68,7 @@ class SkeletonModification2DCCDIK : public SkeletonModification2D {
void update_tip_cache();
void ccdik_joint_update_bone2d_cache(int p_joint_idx);
- void _execute_ccdik_joint(int p_joint_idx, Node2D *target, Node2D *tip);
+ void _execute_ccdik_joint(int p_joint_idx, Node2D *p_target, Node2D *p_tip);
protected:
static void _bind_methods();
@@ -77,7 +77,7 @@ class SkeletonModification2DCCDIK : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void _draw_editor_gizmo() override;
diff --git a/scene/resources/skeleton_modification_2d_fabrik.cpp b/scene/resources/skeleton_modification_2d_fabrik.cpp
index 73ee63ae2f9e..aef852f7e48a 100644
--- a/scene/resources/skeleton_modification_2d_fabrik.cpp
+++ b/scene/resources/skeleton_modification_2d_fabrik.cpp
@@ -95,7 +95,7 @@ void SkeletonModification2DFABRIK::_get_property_list(List *p_list
}
}
-void SkeletonModification2DFABRIK::_execute(float delta) {
+void SkeletonModification2DFABRIK::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
diff --git a/scene/resources/skeleton_modification_2d_fabrik.h b/scene/resources/skeleton_modification_2d_fabrik.h
index 1d4514b432c0..79e0106e2665 100644
--- a/scene/resources/skeleton_modification_2d_fabrik.h
+++ b/scene/resources/skeleton_modification_2d_fabrik.h
@@ -82,7 +82,7 @@ class SkeletonModification2DFABRIK : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void set_target_node(const NodePath &p_target_node);
diff --git a/scene/resources/skeleton_modification_2d_jiggle.cpp b/scene/resources/skeleton_modification_2d_jiggle.cpp
index 47487ef5b06c..d441e3346b96 100644
--- a/scene/resources/skeleton_modification_2d_jiggle.cpp
+++ b/scene/resources/skeleton_modification_2d_jiggle.cpp
@@ -128,7 +128,7 @@ void SkeletonModification2DJiggle::_get_property_list(List *p_list
}
}
-void SkeletonModification2DJiggle::_execute(float delta) {
+void SkeletonModification2DJiggle::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
@@ -146,11 +146,11 @@ void SkeletonModification2DJiggle::_execute(float delta) {
}
for (int i = 0; i < jiggle_data_chain.size(); i++) {
- _execute_jiggle_joint(i, target, delta);
+ _execute_jiggle_joint(i, target, p_delta);
}
}
-void SkeletonModification2DJiggle::_execute_jiggle_joint(int p_joint_idx, Node2D *target, float delta) {
+void SkeletonModification2DJiggle::_execute_jiggle_joint(int p_joint_idx, Node2D *p_target, float p_delta) {
// Adopted from: https://wiki.unity3d.com/index.php/JiggleBone
// With modifications by TwistedTwigleg.
@@ -171,12 +171,12 @@ void SkeletonModification2DJiggle::_execute_jiggle_joint(int p_joint_idx, Node2D
}
Transform2D operation_bone_trans = operation_bone->get_global_transform();
- Vector2 target_position = target->get_global_transform().get_origin();
+ Vector2 target_position = p_target->get_global_transform().get_origin();
- jiggle_data_chain.write[p_joint_idx].force = (target_position - jiggle_data_chain[p_joint_idx].dynamic_position) * jiggle_data_chain[p_joint_idx].stiffness * delta;
+ jiggle_data_chain.write[p_joint_idx].force = (target_position - jiggle_data_chain[p_joint_idx].dynamic_position) * jiggle_data_chain[p_joint_idx].stiffness * p_delta;
if (jiggle_data_chain[p_joint_idx].use_gravity) {
- jiggle_data_chain.write[p_joint_idx].force += jiggle_data_chain[p_joint_idx].gravity * delta;
+ jiggle_data_chain.write[p_joint_idx].force += jiggle_data_chain[p_joint_idx].gravity * p_delta;
}
jiggle_data_chain.write[p_joint_idx].acceleration = jiggle_data_chain[p_joint_idx].force / jiggle_data_chain[p_joint_idx].mass;
diff --git a/scene/resources/skeleton_modification_2d_jiggle.h b/scene/resources/skeleton_modification_2d_jiggle.h
index 247e0a147e6a..e24038a1db51 100644
--- a/scene/resources/skeleton_modification_2d_jiggle.h
+++ b/scene/resources/skeleton_modification_2d_jiggle.h
@@ -79,7 +79,7 @@ class SkeletonModification2DJiggle : public SkeletonModification2D {
uint32_t collision_mask = 1;
void jiggle_joint_update_bone2d_cache(int p_joint_idx);
- void _execute_jiggle_joint(int p_joint_idx, Node2D *target, float delta);
+ void _execute_jiggle_joint(int p_joint_idx, Node2D *p_target, float p_delta);
void _update_jiggle_joint_data();
protected:
@@ -89,7 +89,7 @@ class SkeletonModification2DJiggle : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void set_target_node(const NodePath &p_target_node);
diff --git a/scene/resources/skeleton_modification_2d_lookat.cpp b/scene/resources/skeleton_modification_2d_lookat.cpp
index 4fc429a7c45d..fd5c8c7cc229 100644
--- a/scene/resources/skeleton_modification_2d_lookat.cpp
+++ b/scene/resources/skeleton_modification_2d_lookat.cpp
@@ -104,7 +104,7 @@ void SkeletonModification2DLookAt::_get_property_list(List *p_list
#endif // TOOLS_ENABLED
}
-void SkeletonModification2DLookAt::_execute(float delta) {
+void SkeletonModification2DLookAt::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
diff --git a/scene/resources/skeleton_modification_2d_lookat.h b/scene/resources/skeleton_modification_2d_lookat.h
index 0576d6db8989..6aff30b826e2 100644
--- a/scene/resources/skeleton_modification_2d_lookat.h
+++ b/scene/resources/skeleton_modification_2d_lookat.h
@@ -67,7 +67,7 @@ class SkeletonModification2DLookAt : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void _draw_editor_gizmo() override;
diff --git a/scene/resources/skeleton_modification_2d_physicalbones.cpp b/scene/resources/skeleton_modification_2d_physicalbones.cpp
index ced2ed124b56..f2ed169bb006 100644
--- a/scene/resources/skeleton_modification_2d_physicalbones.cpp
+++ b/scene/resources/skeleton_modification_2d_physicalbones.cpp
@@ -99,7 +99,7 @@ void SkeletonModification2DPhysicalBones::_get_property_list(List
}
}
-void SkeletonModification2DPhysicalBones::_execute(float delta) {
+void SkeletonModification2DPhysicalBones::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
diff --git a/scene/resources/skeleton_modification_2d_physicalbones.h b/scene/resources/skeleton_modification_2d_physicalbones.h
index 5d3d9c73b660..cdf6a5f570d4 100644
--- a/scene/resources/skeleton_modification_2d_physicalbones.h
+++ b/scene/resources/skeleton_modification_2d_physicalbones.h
@@ -62,7 +62,7 @@ class SkeletonModification2DPhysicalBones : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
int get_physical_bone_chain_length();
diff --git a/scene/resources/skeleton_modification_2d_stackholder.cpp b/scene/resources/skeleton_modification_2d_stackholder.cpp
index 940d8b225175..9436092cd9e0 100644
--- a/scene/resources/skeleton_modification_2d_stackholder.cpp
+++ b/scene/resources/skeleton_modification_2d_stackholder.cpp
@@ -73,12 +73,12 @@ void SkeletonModification2DStackHolder::_get_property_list(List *p
#endif // TOOLS_ENABLED
}
-void SkeletonModification2DStackHolder::_execute(float delta) {
+void SkeletonModification2DStackHolder::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (held_modification_stack.is_valid()) {
- held_modification_stack->execute(delta, execution_mode);
+ held_modification_stack->execute(p_delta, execution_mode);
}
}
diff --git a/scene/resources/skeleton_modification_2d_stackholder.h b/scene/resources/skeleton_modification_2d_stackholder.h
index 44a9be1387af..9cc38e39425c 100644
--- a/scene/resources/skeleton_modification_2d_stackholder.h
+++ b/scene/resources/skeleton_modification_2d_stackholder.h
@@ -50,7 +50,7 @@ class SkeletonModification2DStackHolder : public SkeletonModification2D {
public:
Ref held_modification_stack;
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void _draw_editor_gizmo() override;
diff --git a/scene/resources/skeleton_modification_2d_twoboneik.cpp b/scene/resources/skeleton_modification_2d_twoboneik.cpp
index c4ea77ff6272..0a912900152f 100644
--- a/scene/resources/skeleton_modification_2d_twoboneik.cpp
+++ b/scene/resources/skeleton_modification_2d_twoboneik.cpp
@@ -98,7 +98,7 @@ void SkeletonModification2DTwoBoneIK::_get_property_list(List *p_l
#endif // TOOLS_ENABLED
}
-void SkeletonModification2DTwoBoneIK::_execute(float delta) {
+void SkeletonModification2DTwoBoneIK::_execute(float p_delta) {
ERR_FAIL_COND_MSG(!stack || !is_setup || stack->skeleton == nullptr,
"Modification is not setup and therefore cannot execute!");
if (!enabled) {
diff --git a/scene/resources/skeleton_modification_2d_twoboneik.h b/scene/resources/skeleton_modification_2d_twoboneik.h
index 8b5f876a1412..c7e545a48894 100644
--- a/scene/resources/skeleton_modification_2d_twoboneik.h
+++ b/scene/resources/skeleton_modification_2d_twoboneik.h
@@ -71,7 +71,7 @@ class SkeletonModification2DTwoBoneIK : public SkeletonModification2D {
void _get_property_list(List *p_list) const;
public:
- void _execute(float delta) override;
+ void _execute(float p_delta) override;
void _setup_modification(SkeletonModificationStack2D *p_stack) override;
void _draw_editor_gizmo() override;
diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/skeleton_modification_stack_2d.cpp
index 07787ea226b6..d12ec4add30a 100644
--- a/scene/resources/skeleton_modification_stack_2d.cpp
+++ b/scene/resources/skeleton_modification_stack_2d.cpp
@@ -86,7 +86,7 @@ void SkeletonModificationStack2D::setup() {
}
}
-void SkeletonModificationStack2D::execute(float delta, int p_execution_mode) {
+void SkeletonModificationStack2D::execute(float p_delta, int p_execution_mode) {
ERR_FAIL_COND_MSG(!is_setup || skeleton == nullptr || is_queued_for_deletion(),
"Modification stack is not properly setup and therefore cannot execute!");
@@ -105,7 +105,7 @@ void SkeletonModificationStack2D::execute(float delta, int p_execution_mode) {
}
if (modifications[i]->get_execution_mode() == p_execution_mode) {
- modifications.get(i)->_execute(delta);
+ modifications.get(i)->_execute(p_delta);
}
}
}
diff --git a/scene/resources/skeleton_modification_stack_2d.h b/scene/resources/skeleton_modification_stack_2d.h
index 59d9f43a046e..58855701a193 100644
--- a/scene/resources/skeleton_modification_stack_2d.h
+++ b/scene/resources/skeleton_modification_stack_2d.h
@@ -67,7 +67,7 @@ class SkeletonModificationStack2D : public Resource {
Vector[> modifications = Vector][>();
void setup();
- void execute(float delta, int p_execution_mode);
+ void execute(float p_delta, int p_execution_mode);
bool editor_gizmo_dirty = false;
void draw_editor_gizmos();
]