Просмотр исходного кода

static_assert -> JPH_ASSERT

For some reason (that I cannot reproduce on my machine) the godot CI doesn't compile with it
Jorrit Rouwe 6 дней назад
Родитель
Сommit
365a15367e
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      Jolt/Physics/Constraints/ContactConstraintManager.cpp

+ 8 - 2
Jolt/Physics/Constraints/ContactConstraintManager.cpp

@@ -70,7 +70,10 @@ JPH_INLINE void ContactConstraintManager::WorldContactPoint::TemplatedCalculateF
 	else if constexpr (Type2 != EMotionType::Static)
 	else if constexpr (Type2 != EMotionType::Static)
 		relative_velocity = mp2->GetPointVelocityCOM(r2);
 		relative_velocity = mp2->GetPointVelocityCOM(r2);
 	else
 	else
-		static_assert(false, "Static vs static makes no sense");
+	{
+		JPH_ASSERT(false, "Static vs static makes no sense");
+		relative_velocity = Vec3::sZero();
+	}
 	float normal_velocity = relative_velocity.Dot(inWorldSpaceNormal);
 	float normal_velocity = relative_velocity.Dot(inWorldSpaceNormal);
 
 
 	// How much the shapes are penetrating (> 0 if penetrating, < 0 if separated)
 	// How much the shapes are penetrating (> 0 if penetrating, < 0 if separated)
@@ -109,7 +112,10 @@ JPH_INLINE void ContactConstraintManager::WorldContactPoint::TemplatedCalculateF
 			else if constexpr (Type2 != EMotionType::Static)
 			else if constexpr (Type2 != EMotionType::Static)
 				relative_acceleration = inGravity * mp2->GetGravityFactor();
 				relative_acceleration = inGravity * mp2->GetGravityFactor();
 			else
 			else
-				static_assert(false, "Static vs static makes no sense");
+			{
+				JPH_ASSERT(false, "Static vs static makes no sense");
+				relative_acceleration = Vec3::sZero();
+			}
 
 
 			// Calculate effect of accumulated forces
 			// Calculate effect of accumulated forces
 			if constexpr (Type1 == EMotionType::Dynamic)
 			if constexpr (Type1 == EMotionType::Dynamic)