From 21c224af257bf6ff3c401cfefaff0c0769a30670 Mon Sep 17 00:00:00 2001 From: gugus Date: Fri, 18 Mar 2011 13:32:42 +0100 Subject: [PATCH] add gravity change to the ToggleCollisionMode function. --- apps/openmw/mwrender/mwscene.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/mwscene.cpp b/apps/openmw/mwrender/mwscene.cpp index e937bf2798..ce54e8a198 100644 --- a/apps/openmw/mwrender/mwscene.cpp +++ b/apps/openmw/mwrender/mwscene.cpp @@ -207,6 +207,16 @@ void MWScene::toggleCollisionMode() for(std::map::iterator it = eng->PhysicActorMap.begin(); it != eng->PhysicActorMap.end();it++) { 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); + } } }