Browse Source

RotatedTranslatedShape::GetPosition returned the wrong value

Thanks @cbirkhold for finding this!
Jorrit Rouwe 1 year ago
parent
commit
c8829c4f68
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h

+ 1 - 1
Jolt/Physics/Collision/Shape/RotatedTranslatedShape.h

@@ -49,7 +49,7 @@ public:
 	Quat							GetRotation() const										{ return mRotation; }
 
 	/// Access the translation that has been applied to the inner shape
-	Vec3							GetPosition() const										{ return mCenterOfMass - mRotation.InverseRotate(mInnerShape->GetCenterOfMass()); }
+	Vec3							GetPosition() const										{ return mCenterOfMass - mRotation * mInnerShape->GetCenterOfMass(); }
 
 	// See Shape::GetCenterOfMass
 	virtual Vec3					GetCenterOfMass() const override						{ return mCenterOfMass; }