mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 05:45:35 +00:00
add gravity change to the ToggleCollisionMode function.
This commit is contained in:
parent
102f1ee5dc
commit
21c224af25
1 changed files with 11 additions and 1 deletions
|
@ -207,6 +207,16 @@ void MWScene::toggleCollisionMode()
|
||||||
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = eng->PhysicActorMap.begin(); it != eng->PhysicActorMap.end();it++)
|
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = eng->PhysicActorMap.begin(); it != eng->PhysicActorMap.end();it++)
|
||||||
{
|
{
|
||||||
OEngine::Physic::PhysicActor* act = it->second;
|
OEngine::Physic::PhysicActor* act = it->second;
|
||||||
act->enableCollisions(!act->getCollisionMode());
|
bool cmode = act->getCollisionMode();
|
||||||
|
if(cmode)
|
||||||
|
{
|
||||||
|
act->enableCollisions(false);
|
||||||
|
act->setGravity(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
act->enableCollisions(true);
|
||||||
|
act->setGravity(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue