Physics2D: Handle kinematic objects properly

This commit is contained in:
Jérôme Leclercq
2017-09-07 16:16:11 +02:00
parent 305a72a7d2
commit 3153af485c
4 changed files with 46 additions and 39 deletions

View File

@@ -143,9 +143,9 @@ namespace Nz
return ColliderType2D_Null;
}
float NullCollider2D::ComputeMomentOfInertia(float /*mass*/) const
float NullCollider2D::ComputeMomentOfInertia(float mass) const
{
return 0.f;
return (mass > 0.f) ? 1.f : 0.f; //< Null inertia is only possible for static/kinematic objects
}
void NullCollider2D::CreateShapes(RigidBody2D* /*body*/, std::vector<cpShape*>& /*shapes*/) const