Physics/PhysObject: PhysObject now always have a valid geom

Former-commit-id: 3b93b318545a7f0b28a9afd82868c7460f63a80f
This commit is contained in:
Lynix 2015-04-20 13:39:40 +02:00
parent 1a403eb79c
commit a71c86c0ca
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,9 @@ m_gravityFactor(1.f),
m_mass(0.f)
{
NazaraAssert(m_world, "Invalid world");
NazaraAssert(m_geom, "Invalid geometry");
if (!m_geom)
m_geom = NzNullGeom::New();
m_body = NewtonCreateDynamicBody(m_world->GetHandle(), m_geom->GetHandle(m_world), m_matrix);
NewtonBodySetUserData(m_body, this);