mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 20:36:42 +00:00
Actually rotate the object when updating physics
This commit is contained in:
parent
b6f2b39a2f
commit
18e8ff7198
2 changed files with 16 additions and 6 deletions
|
@ -806,13 +806,8 @@ namespace MWWorld
|
||||||
mPhysics->scaleObject(ptr);
|
mPhysics->scaleObject(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::rotateObject (const Ptr& ptr,float x,float y,float z, bool adjust)
|
void World::rotateObjectImp (const Ptr& ptr, Ogre::Vector3 rot, bool adjust)
|
||||||
{
|
{
|
||||||
Ogre::Vector3 rot;
|
|
||||||
rot.x = Ogre::Degree(x).valueRadians();
|
|
||||||
rot.y = Ogre::Degree(y).valueRadians();
|
|
||||||
rot.z = Ogre::Degree(z).valueRadians();
|
|
||||||
|
|
||||||
if (mRendering->rotateObject(ptr, rot, adjust))
|
if (mRendering->rotateObject(ptr, rot, adjust))
|
||||||
{
|
{
|
||||||
// rotate physically iff renderer confirm so
|
// rotate physically iff renderer confirm so
|
||||||
|
@ -827,6 +822,14 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::rotateObject (const Ptr& ptr,float x,float y,float z, bool adjust)
|
||||||
|
{
|
||||||
|
rotateObjectImp(ptr, Ogre::Vector3(Ogre::Degree(x).valueRadians(),
|
||||||
|
Ogre::Degree(y).valueRadians(),
|
||||||
|
Ogre::Degree(z).valueRadians()),
|
||||||
|
adjust);
|
||||||
|
}
|
||||||
|
|
||||||
void World::safePlaceObject(const MWWorld::Ptr& ptr,MWWorld::CellStore &Cell,ESM::Position pos)
|
void World::safePlaceObject(const MWWorld::Ptr& ptr,MWWorld::CellStore &Cell,ESM::Position pos)
|
||||||
{
|
{
|
||||||
copyObjectToCell(ptr,Cell,pos);
|
copyObjectToCell(ptr,Cell,pos);
|
||||||
|
@ -876,12 +879,17 @@ namespace MWWorld
|
||||||
player = iter;
|
player = iter;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rotateObjectImp(iter->first, Ogre::Vector3(iter->second.mRotation), true);
|
||||||
|
|
||||||
Ogre::Vector3 vec = mPhysics->move(iter->first, Ogre::Vector3(iter->second.mPosition), duration,
|
Ogre::Vector3 vec = mPhysics->move(iter->first, Ogre::Vector3(iter->second.mPosition), duration,
|
||||||
!isSwimming(iter->first) && !isFlying(iter->first));
|
!isSwimming(iter->first) && !isFlying(iter->first));
|
||||||
moveObjectImp(iter->first, vec.x, vec.y, vec.z);
|
moveObjectImp(iter->first, vec.x, vec.y, vec.z);
|
||||||
}
|
}
|
||||||
if(player != actors.end())
|
if(player != actors.end())
|
||||||
{
|
{
|
||||||
|
rotateObjectImp(player->first, Ogre::Vector3(player->second.mRotation), true);
|
||||||
|
|
||||||
Ogre::Vector3 vec = mPhysics->move(player->first, Ogre::Vector3(player->second.mPosition), duration,
|
Ogre::Vector3 vec = mPhysics->move(player->first, Ogre::Vector3(player->second.mPosition), duration,
|
||||||
!isSwimming(player->first) && !isFlying(player->first));
|
!isSwimming(player->first) && !isFlying(player->first));
|
||||||
moveObjectImp(player->first, vec.x, vec.y, vec.z);
|
moveObjectImp(player->first, vec.x, vec.y, vec.z);
|
||||||
|
|
|
@ -90,6 +90,8 @@ namespace MWWorld
|
||||||
|
|
||||||
int getDaysPerMonth (int month) const;
|
int getDaysPerMonth (int month) const;
|
||||||
|
|
||||||
|
void rotateObjectImp (const Ptr& ptr, Ogre::Vector3 rot, bool adjust);
|
||||||
|
|
||||||
bool moveObjectImp (const Ptr& ptr, float x, float y, float z);
|
bool moveObjectImp (const Ptr& ptr, float x, float y, float z);
|
||||||
///< @return true if the active cell (cell player is in) changed
|
///< @return true if the active cell (cell player is in) changed
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue