mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 21:40:15 +00:00
const std::string* to std::string
This commit is contained in:
parent
52bf3af565
commit
7cf66443df
@ -25,7 +25,7 @@ namespace MWWorld
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector< std::pair<const 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)
|
||||||
{
|
{
|
||||||
// stop changes to world from being reported back to the physics system
|
// stop changes to world from being reported back to the physics system
|
||||||
@ -71,13 +71,13 @@ namespace MWWorld
|
|||||||
}
|
}
|
||||||
mEngine->stepSimulation(duration);
|
mEngine->stepSimulation(duration);
|
||||||
|
|
||||||
std::vector< std::pair<const std::string*, Ogre::Vector3> > response;
|
std::vector< std::pair<std::string, Ogre::Vector3> > response;
|
||||||
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = mEngine->PhysicActorMap.begin(); it != mEngine->PhysicActorMap.end();it++)
|
for(std::map<std::string,OEngine::Physic::PhysicActor*>::iterator it = mEngine->PhysicActorMap.begin(); it != mEngine->PhysicActorMap.end();it++)
|
||||||
{
|
{
|
||||||
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<const std::string*, Ogre::Vector3>(&it->first, coord));
|
response.push_back(std::pair<std::string, Ogre::Vector3>(it->first, coord));
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ namespace MWWorld
|
|||||||
PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng);
|
PhysicsSystem (OEngine::Render::OgreRenderer &_rend , OEngine::Physic::PhysicEngine* physEng);
|
||||||
~PhysicsSystem ();
|
~PhysicsSystem ();
|
||||||
|
|
||||||
std::vector< std::pair<const 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,
|
||||||
|
@ -713,10 +713,10 @@ namespace MWWorld
|
|||||||
void World::doPhysics (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors,
|
void World::doPhysics (const std::vector<std::pair<std::string, Ogre::Vector3> >& actors,
|
||||||
float duration)
|
float duration)
|
||||||
{
|
{
|
||||||
std::vector< std::pair<const std::string*, Ogre::Vector3> > vectors = mPhysics->doPhysics (duration, actors);
|
std::vector< std::pair<std::string, Ogre::Vector3> > vectors = mPhysics->doPhysics (duration, actors);
|
||||||
std::vector< std::pair<const std::string*, Ogre::Vector3> >::iterator it;
|
std::vector< std::pair<std::string, Ogre::Vector3> >::iterator it;
|
||||||
for(it = vectors.begin(); it != vectors.end(); it++) {
|
for(it = vectors.begin(); it != vectors.end(); it++) {
|
||||||
MWWorld::Ptr ptr = getPtrViaHandle (*it->first);
|
MWWorld::Ptr ptr = getPtrViaHandle (it->first);
|
||||||
moveObject (ptr, it->second.x, it->second.y, it->second.z);
|
moveObject (ptr, it->second.x, it->second.y, it->second.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user