summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/skeleton_modification_2d_jiggle.cpp8
-rw-r--r--scene/resources/skeleton_modification_3d_jiggle.cpp8
2 files changed, 12 insertions, 4 deletions
diff --git a/scene/resources/skeleton_modification_2d_jiggle.cpp b/scene/resources/skeleton_modification_2d_jiggle.cpp
index 84abc9d020..31045455a3 100644
--- a/scene/resources/skeleton_modification_2d_jiggle.cpp
+++ b/scene/resources/skeleton_modification_2d_jiggle.cpp
@@ -194,9 +194,13 @@ void SkeletonModification2DJiggle::_execute_jiggle_joint(int p_joint_idx, Node2D
PhysicsDirectSpaceState2D *space_state = PhysicsServer2D::get_singleton()->space_get_direct_state(world_2d->get_space());
PhysicsDirectSpaceState2D::RayResult ray_result;
+ PhysicsDirectSpaceState2D::RayParameters ray_params;
+ ray_params.from = operation_bone_trans.get_origin();
+ ray_params.to = jiggle_data_chain[p_joint_idx].dynamic_position;
+ ray_params.collision_mask = collision_mask;
+
// Add exception support?
- bool ray_hit = space_state->intersect_ray(operation_bone_trans.get_origin(), jiggle_data_chain[p_joint_idx].dynamic_position,
- ray_result, Set<RID>(), collision_mask);
+ bool ray_hit = space_state->intersect_ray(ray_params, ray_result);
if (ray_hit) {
jiggle_data_chain.write[p_joint_idx].dynamic_position = jiggle_data_chain[p_joint_idx].last_noncollision_position;
diff --git a/scene/resources/skeleton_modification_3d_jiggle.cpp b/scene/resources/skeleton_modification_3d_jiggle.cpp
index a6bcb0176a..2535f2b987 100644
--- a/scene/resources/skeleton_modification_3d_jiggle.cpp
+++ b/scene/resources/skeleton_modification_3d_jiggle.cpp
@@ -206,8 +206,12 @@ void SkeletonModification3DJiggle::_execute_jiggle_joint(int p_joint_idx, Node3D
Transform3D new_bone_trans_world = stack->skeleton->global_pose_to_world_transform(new_bone_trans);
Transform3D dynamic_position_world = stack->skeleton->global_pose_to_world_transform(Transform3D(Basis(), jiggle_data_chain[p_joint_idx].dynamic_position));
- bool ray_hit = space_state->intersect_ray(new_bone_trans_world.origin, dynamic_position_world.get_origin(),
- ray_result, Set<RID>(), collision_mask);
+ PhysicsDirectSpaceState3D::RayParameters ray_params;
+ ray_params.from = new_bone_trans_world.origin;
+ ray_params.to = dynamic_position_world.get_origin();
+ ray_params.collision_mask = collision_mask;
+
+ bool ray_hit = space_state->intersect_ray(ray_params, ray_result);
if (ray_hit) {
jiggle_data_chain[p_joint_idx].dynamic_position = jiggle_data_chain[p_joint_idx].last_noncollision_position;