Sdk/DebugSystem: Fix collision 2D offset
This commit is contained in:
parent
4821eb14a7
commit
4ff43f2f72
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue