forked from mirror/openmw-tes3mp
simplified actor-related physics interface to mwscene
This commit is contained in:
parent
5c1aae3e26
commit
9807e7dadc
3 changed files with 7 additions and 17 deletions
|
@ -102,14 +102,15 @@ std::pair<std::string, float> MWScene::getFacedHandle (MWWorld::World& world)
|
|||
return std::pair<std::string, float>(handle, distance);
|
||||
}
|
||||
|
||||
void MWScene::doPhysics (float duration, MWWorld::World& world)
|
||||
void MWScene::doPhysics (float duration, MWWorld::World& world,
|
||||
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors)
|
||||
{
|
||||
// stop changes to world from being reported back to the physics system
|
||||
MWWorld::DoingPhysics scopeGuard;
|
||||
|
||||
// move object directly for now -> TODO replace with physics
|
||||
for (std::vector<std::pair<std::string, Ogre::Vector3> >::const_iterator iter (mMovement.begin());
|
||||
iter!=mMovement.end(); ++iter)
|
||||
for (std::vector<std::pair<std::string, Ogre::Vector3> >::const_iterator iter (actors.begin());
|
||||
iter!=actors.end(); ++iter)
|
||||
{
|
||||
MWWorld::Ptr ptr = world.getPtrViaHandle (iter->first);
|
||||
|
||||
|
@ -121,11 +122,6 @@ void MWScene::doPhysics (float duration, MWWorld::World& world)
|
|||
}
|
||||
}
|
||||
|
||||
void MWScene::setMovement (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors)
|
||||
{
|
||||
mMovement = actors;
|
||||
}
|
||||
|
||||
void MWScene::addObject (const std::string& handle, const std::string& mesh,
|
||||
const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position)
|
||||
{
|
||||
|
|
|
@ -41,8 +41,6 @@ namespace MWRender
|
|||
|
||||
MWRender::Player *mPlayer;
|
||||
|
||||
std::vector<std::pair<std::string, Ogre::Vector3> > mMovement;
|
||||
|
||||
public:
|
||||
|
||||
MWScene (OEngine::Render::OgreRenderer &_rend);
|
||||
|
@ -63,11 +61,8 @@ namespace MWRender
|
|||
std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
|
||||
|
||||
/// Run physics simulation and modify \a world accordingly.
|
||||
void doPhysics (float duration, MWWorld::World& world);
|
||||
|
||||
/// Inform phyiscs system about desired velocity vectors for actors
|
||||
/// (in Morrowind coordinates).
|
||||
void setMovement (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors);
|
||||
void doPhysics (float duration, MWWorld::World& world,
|
||||
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors);
|
||||
|
||||
/// Add object to physics system.
|
||||
void addObject (const std::string& handle, const std::string& mesh,
|
||||
|
|
|
@ -847,7 +847,6 @@ namespace MWWorld
|
|||
void World::doPhysics (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors,
|
||||
float duration)
|
||||
{
|
||||
mScene.setMovement (actors);
|
||||
mScene.doPhysics (duration, *this);
|
||||
mScene.doPhysics (duration, *this, actors);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue