mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
remove actor's collisionbox on death
This commit is contained in:
parent
b095c24854
commit
f43b48015e
3 changed files with 16 additions and 3 deletions
|
@ -1756,13 +1756,13 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||||
|
|
||||||
if (!enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
physicActor->setScale(0.15);
|
physicActor->enableCollisionBody();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
physicActor->setScale(1);
|
physicActor->disableCollisionBody();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,16 @@ namespace Physic
|
||||||
return collisionMode && onGround;
|
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;
|
bool getOnGround() const;
|
||||||
|
|
||||||
|
void disableCollisionBody();
|
||||||
|
void enableCollisionBody();
|
||||||
|
|
||||||
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
//HACK: in Visual Studio 2010 and presumably above, this structures alignment
|
||||||
// must be 16, but the built in operator new & delete don't properly
|
// must be 16, but the built in operator new & delete don't properly
|
||||||
// perform this alignment.
|
// perform this alignment.
|
||||||
|
|
Loading…
Reference in a new issue