mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
remove actor's collisionbox on death
This commit is contained in:
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…
x
Reference in New Issue
Block a user