fixed collision mode interface and redirected collision mode script instruction from Player class to MWScene class

This commit is contained in:
Marc Zinnschlag 2011-03-13 22:33:55 +01:00
parent a14db99aa8
commit eb93ef68f1
5 changed files with 13 additions and 4 deletions

View file

@ -200,7 +200,7 @@ void MWScene::scaleObject (const std::string& handle, float scale)
} }
void MWScene::setCollsionMode (bool enabled) void MWScene::toggleCollisionMode()
{ {
} }

View file

@ -87,9 +87,9 @@ namespace MWRender
/// Change object's scale. /// Change object's scale.
void scaleObject (const std::string& handle, float scale); void scaleObject (const std::string& handle, float scale);
/// Set collision mode for player. If disabled player object should ignore /// Toggle collision mode for player. If disabled player object should ignore
/// collisions and gravity. /// collisions and gravity.
void setCollsionMode (bool enabled); void toggleCollisionMode();
}; };
} }

View file

@ -46,7 +46,7 @@ namespace MWScript
InterpreterContext& context InterpreterContext& context
= static_cast<InterpreterContext&> (runtime.getContext()); = static_cast<InterpreterContext&> (runtime.getContext());
context.getWorld().getPlayer().toggleCollisionMode(); context.getWorld().toggleCollisionMode();
} }
}; };

View file

@ -855,4 +855,9 @@ namespace MWWorld
{ {
mScene.doPhysics (duration, *this, actors); mScene.doPhysics (duration, *this, actors);
} }
void World::toggleCollisionMode()
{
mScene.toggleCollisionMode();
}
} }

View file

@ -179,6 +179,10 @@ namespace MWWorld
void doPhysics (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors, void doPhysics (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors,
float duration); float duration);
///< Run physics simulation and modify \a world accordingly. ///< Run physics simulation and modify \a world accordingly.
void toggleCollisionMode();
///< Toggle collision mode for player. If disabled player object should ignore
/// collisions and gravity.
}; };
} }