Browse Source

Bugfix: GetWorldTransform applied center of mass with the wrong sign

Jorrit Rouwe 3 years ago
parent
commit
491bee092b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jolt/Physics/Body/Body.inl

+ 1 - 1
Jolt/Physics/Body/Body.inl

@@ -9,7 +9,7 @@ Mat44 Body::GetWorldTransform() const
 {
 {
 	JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); 
 	JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); 
 
 
-	return Mat44::sRotationTranslation(mRotation, mPosition).PreTranslated(mShape->GetCenterOfMass());
+	return Mat44::sRotationTranslation(mRotation, mPosition).PreTranslated(-mShape->GetCenterOfMass());
 }
 }
 
 
 Mat44 Body::GetCenterOfMassTransform() const
 Mat44 Body::GetCenterOfMassTransform() const