mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
resize actor collision boxes on death
This commit is contained in:
parent
e88040662e
commit
b095c24854
4 changed files with 22 additions and 0 deletions
|
@ -345,6 +345,8 @@ namespace MWBase
|
|||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out) = 0;
|
||||
///< get all items in active cells owned by this Npc
|
||||
|
||||
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable) = 0;
|
||||
|
||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0;
|
||||
|
||||
virtual int canRest() = 0;
|
||||
|
|
|
@ -462,6 +462,10 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
mAnimation->disable("torch");
|
||||
}
|
||||
}
|
||||
else if (cls.getCreatureStats(mPtr).isDead())
|
||||
{
|
||||
MWBase::Environment::get().getWorld()->enableActorCollision(mPtr, false);
|
||||
}
|
||||
|
||||
if(mAnimation && !mSkipAnim)
|
||||
{
|
||||
|
|
|
@ -1751,4 +1751,18 @@ namespace MWWorld
|
|||
out.push_back(searchPtrViaHandle(*it));
|
||||
}
|
||||
}
|
||||
|
||||
void World::enableActorCollision(const MWWorld::Ptr& actor, bool enable)
|
||||
{
|
||||
OEngine::Physic::PhysicActor *physicActor = mPhysEngine->getCharacter(actor.getRefData().getHandle());
|
||||
|
||||
if (!enable)
|
||||
{
|
||||
physicActor->setScale(0.15);
|
||||
}
|
||||
else
|
||||
{
|
||||
physicActor->setScale(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -394,6 +394,8 @@ namespace MWWorld
|
|||
virtual void getItemsOwnedBy (const MWWorld::Ptr& npc, std::vector<MWWorld::Ptr>& out);
|
||||
///< get all items in active cells owned by this Npc
|
||||
|
||||
virtual void enableActorCollision(const MWWorld::Ptr& actor, bool enable);
|
||||
|
||||
virtual void setupExternalRendering (MWRender::ExternalRendering& rendering);
|
||||
|
||||
virtual int canRest();
|
||||
|
|
Loading…
Reference in a new issue