diff options
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/node_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.cpp | 11 | ||||
-rw-r--r-- | scene/3d/skeleton_3d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/soft_dynamic_body_3d.cpp | 2 |
6 files changed, 14 insertions, 7 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 34f748b197..efe23c6102 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -311,7 +311,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { while (stream_playbacks.size() > max_polyphony) { AudioServer::get_singleton()->stop_playback_stream(stream_playbacks[0]); - stream_playbacks.remove(0); + stream_playbacks.remove_at(0); } } } diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index a166a05c71..085f1ade66 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -628,7 +628,7 @@ void CollisionObject3D::shape_owner_remove_shape(uint32_t p_owner, int p_shape) --debug_shapes_count; } - shapes[p_owner].shapes.remove(p_shape); + shapes[p_owner].shapes.remove_at(p_shape); for (KeyValue<uint32_t, ShapeData> &E : shapes) { for (int i = 0; i < E.value.shapes.size(); i++) { diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index b7b88c7135..ddd9d2da8a 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -478,7 +478,7 @@ void Node3D::remove_gizmo(Ref<Node3DGizmo> p_gizmo) { int idx = data.gizmos.find(p_gizmo); if (idx != -1) { p_gizmo->free(); - data.gizmos.remove(idx); + data.gizmos.remove_at(idx); } #endif } diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index edaf76bc3e..393e29e398 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1328,8 +1328,15 @@ void CharacterBody3D::_move_and_slide_grounded(double p_delta, bool p_was_on_flo // Apply slide on forward in order to allow only lateral motion on next step. Vector3 forward = wall_normal.slide(up_direction).normalized(); motion = motion.slide(forward); - // Avoid accelerating when you jump on the wall and smooth falling. - motion_velocity = motion_velocity.slide(forward); + + // Scales the horizontal velocity according to the wall slope. + if (vel_dir_facing_up) { + Vector3 slide_motion = motion_velocity.slide(result.collisions[0].normal); + // Keeps the vertical motion from motion_velocity and add the horizontal motion of the projection. + motion_velocity = up_direction * up_direction.dot(motion_velocity) + slide_motion.slide(up_direction); + } else { + motion_velocity = motion_velocity.slide(forward); + } // Allow only lateral motion along previous floor when already on floor. // Fixes slowing down when moving in diagonal against an inclined wall. diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index d4d3c0ebe1..04b5b88ef8 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -633,7 +633,7 @@ void Skeleton3D::remove_bone_child(int p_bone, int p_child) { int child_idx = bones[p_bone].child_bones.find(p_child); if (child_idx >= 0) { - bones.write[p_bone].child_bones.remove(child_idx); + bones.write[p_bone].child_bones.remove_at(child_idx); } else { WARN_PRINT("Cannot remove child bone: Child bone not found."); } diff --git a/scene/3d/soft_dynamic_body_3d.cpp b/scene/3d/soft_dynamic_body_3d.cpp index 903eedb58b..5546b88fb1 100644 --- a/scene/3d/soft_dynamic_body_3d.cpp +++ b/scene/3d/soft_dynamic_body_3d.cpp @@ -773,7 +773,7 @@ void SoftDynamicBody3D::_reset_points_offsets() { void SoftDynamicBody3D::_remove_pinned_point(int p_point_index) { const int id(_has_pinned_point(p_point_index)); if (-1 != id) { - pinned_points.remove(id); + pinned_points.remove_at(id); } } |