Physics2D/RigidBody2D: Fix SetMass need to be called twice

This commit is contained in:
Lynix 2016-11-10 17:24:22 +01:00
parent 9772b43542
commit e4c89f2763
1 changed files with 3 additions and 0 deletions

View File

@ -205,7 +205,10 @@ namespace Nz
else if (mass > 0.f)
{
if (cpBodyGetType(m_handle) == CP_BODY_TYPE_STATIC)
{
cpBodySetType(m_handle, CP_BODY_TYPE_DYNAMIC);
cpBodySetMass(m_handle, mass);
}
}
m_mass = mass;