Godot Engine – Multi-platform 2D and 3D game engine
Jolt: Use PositionAndVelocity motor state when motor and spring are both enabled
Robin Lacey6e0cc0961d40
diff --git a/modules/jolt_physics/joints/jolt_generic_6dof_joint_3d.cpp b/modules/jolt_physics/joints/jolt_generic_6dof_joint_3d.cppindex 8c657ec27bd..f064503bbcb 100644--- a/modules/jolt_physics/joints/jolt_generic_6dof_joint_3d.cpp+++ b/modules/jolt_physics/joints/jolt_generic_6dof_joint_3d.cpp@@ -111,7 +111,9 @@ void JoltGeneric6DOFJoint3D::_update_limit_spring_parameters(int p_axis) {void JoltGeneric6DOFJoint3D::_update_motor_state(int p_axis) {if (JPH::SixDOFConstraint *constraint = static_cast<JPH::SixDOFConstraint *>(jolt_ref.GetPtr())) {- if (motor_enabled[p_axis]) {+ if (motor_enabled[p_axis] && spring_enabled[p_axis]) {+ constraint->SetMotorState((JoltAxis)p_axis, JPH::EMotorState::PositionAndVelocity);+ } else if (motor_enabled[p_axis]) {constraint->SetMotorState((JoltAxis)p_axis, JPH::EMotorState::Velocity);} else if (spring_enabled[p_axis]) {constraint->SetMotorState((JoltAxis)p_axis, JPH::EMotorState::Position);