Sdk/DebugSystem: Fix collision 2D offset

This commit is contained in:
Lynix 2019-03-27 23:10:37 +01:00
parent 4821eb14a7
commit 4ff43f2f72
1 changed files with 1 additions and 1 deletions

View File

@ -377,7 +377,7 @@ namespace Ndk
if (entity->HasComponent<PhysicsComponent2D>()) if (entity->HasComponent<PhysicsComponent2D>())
{ {
const PhysicsComponent2D& entityPhys = entity->GetComponent<PhysicsComponent2D>(); const PhysicsComponent2D& entityPhys = entity->GetComponent<PhysicsComponent2D>();
*offset = entityPhys.GetMassCenter(Nz::CoordSys_Global) - entityPhys.GetPosition(); // GetPosition already takes GetGeomOffset into account *offset = entityPhys.GetMassCenter(Nz::CoordSys_Local) + entityCollision.GetGeomOffset();
} }
else else
*offset = entityCollision.GetGeomOffset(); *offset = entityCollision.GetGeomOffset();