Bladeren bron

Fixed HingeConstraint not having limits if LimitsMin was set to -JPH_PI or LimitsMax was set to JPH_PI. It should only be turned off if both are.

Jorrit Rouwe 6 maanden geleden
bovenliggende
commit
2425c73ba2
2 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 1 0
      Docs/ReleaseNotes.md
  2. 1 1
      Jolt/Physics/Constraints/HingeConstraint.cpp

+ 1 - 0
Docs/ReleaseNotes.md

@@ -51,6 +51,7 @@ For breaking API changes see [this document](https://github.com/jrouwe/JoltPhysi
 * `TempAllocatorImpl` uses 64 bit integers internally to allow for a higher max contact constraint count.
 * When inserting lots of bodies without using batching, a broad phase tree of depth > 128 can be created. If the `PhysicsSystem` was destructed in this situation, a stack overflow would cause a crash.
 * When calling `PhysicsSystem::Update` with a delta time of 0, contact remove callbacks were triggered by accident for all existing contacts.
+* Fixed 'HingeConstraint' not having limits if `LimitsMin` was set to `-JPH_PI` or `LimitsMax` was set to `JPH_PI`. It should only be turned off if both are.
 
 ## v5.2.0
 

+ 1 - 1
Jolt/Physics/Constraints/HingeConstraint.cpp

@@ -140,7 +140,7 @@ void HingeConstraint::SetLimits(float inLimitsMin, float inLimitsMax)
 	JPH_ASSERT(inLimitsMax >= 0.0f && inLimitsMax <= JPH_PI);
 	mLimitsMin = inLimitsMin;
 	mLimitsMax = inLimitsMax;
-	mHasLimits = mLimitsMin > -JPH_PI && mLimitsMax < JPH_PI;
+	mHasLimits = mLimitsMin > -JPH_PI || mLimitsMax < JPH_PI;
 }
 
 void HingeConstraint::CalculateA1AndTheta()