fixed an unitialised variable

This commit is contained in:
Marc Zinnschlag 2011-08-22 21:34:51 +02:00
parent 705e11becb
commit 4191bb32d1
2 changed files with 18 additions and 16 deletions

View file

@ -15,16 +15,16 @@ namespace MWWorld
{ {
PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) : PhysicsSystem::PhysicsSystem(OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng) :
mRender(_rend), mEngine(physEng) mRender(_rend), mEngine(physEng), mFreeFly (true)
{ {
} }
PhysicsSystem::~PhysicsSystem() PhysicsSystem::~PhysicsSystem()
{ {
} }
std::vector< std::pair<std::string, Ogre::Vector3> > PhysicsSystem::doPhysics (float duration, std::vector< std::pair<std::string, Ogre::Vector3> > PhysicsSystem::doPhysics (float duration,
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors) const std::vector<std::pair<std::string, Ogre::Vector3> >& actors)
{ {
@ -76,7 +76,7 @@ namespace MWWorld
{ {
btVector3 newPos = it->second->getPosition(); btVector3 newPos = it->second->getPosition();
Ogre::Vector3 coord(newPos.x(), newPos.y(), newPos.z()); Ogre::Vector3 coord(newPos.x(), newPos.y(), newPos.z());
response.push_back(std::pair<std::string, Ogre::Vector3>(it->first, coord)); response.push_back(std::pair<std::string, Ogre::Vector3>(it->first, coord));
} }
return response; return response;

View file

@ -13,31 +13,33 @@ namespace MWWorld
public: public:
PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng); PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng);
~PhysicsSystem (); ~PhysicsSystem ();
std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration, std::vector< std::pair<std::string, Ogre::Vector3> > doPhysics (float duration,
const std::vector<std::pair<std::string, Ogre::Vector3> >& actors); const std::vector<std::pair<std::string, Ogre::Vector3> >& actors);
void addObject (const std::string& handle, const std::string& mesh, void addObject (const std::string& handle, const std::string& mesh,
const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position); const Ogre::Quaternion& rotation, float scale, const Ogre::Vector3& position);
void addActor (const std::string& handle, const std::string& mesh, void addActor (const std::string& handle, const std::string& mesh,
const Ogre::Vector3& position); const Ogre::Vector3& position);
void removeObject (const std::string& handle); void removeObject (const std::string& handle);
void moveObject (const std::string& handle, const Ogre::Vector3& position, bool updatePhysics); void moveObject (const std::string& handle, const Ogre::Vector3& position, bool updatePhysics);
void rotateObject (const std::string& handle, const Ogre::Quaternion& rotation); void rotateObject (const std::string& handle, const Ogre::Quaternion& rotation);
void scaleObject (const std::string& handle, float scale); void scaleObject (const std::string& handle, float scale);
bool toggleCollisionMode(); bool toggleCollisionMode();
private: private:
OEngine::Render::OgreRenderer &mRender; OEngine::Render::OgreRenderer &mRender;
OEngine::Physic::PhysicEngine* mEngine; OEngine::Physic::PhysicEngine* mEngine;
bool mFreeFly; bool mFreeFly;
PhysicsSystem (const PhysicsSystem&);
PhysicsSystem& operator= (const PhysicsSystem&);
}; };
} }