remove actor's collisionbox on death

actorid
Vincent Heuken 12 years ago
parent b095c24854
commit f43b48015e

@ -1756,13 +1756,13 @@ namespace MWWorld
{
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
if (!enable)
if (enable)
{
physicActor->setScale(0.15);
physicActor->enableCollisionBody();
}
else
{
physicActor->setScale(1);
physicActor->disableCollisionBody();
}
}
}

@ -146,6 +146,16 @@ namespace Physic
return collisionMode && onGround;
}
void PhysicActor::disableCollisionBody()
{
mEngine->dynamicsWorld->removeRigidBody(mBody);
}
void PhysicActor::enableCollisionBody()
{
mEngine->dynamicsWorld->addRigidBody(mBody);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@ -129,6 +129,9 @@ namespace Physic
bool getOnGround() const;
void disableCollisionBody();
void enableCollisionBody();
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
// must be 16, but the built in operator new & delete don't properly
// perform this alignment.

Loading…
Cancel
Save