mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-04 05:45:35 +00:00
Merge remote-tracking branch 'zini/master' into misc-cleanup
This commit is contained in:
commit
9679daa6a4
5 changed files with 20 additions and 17 deletions
|
@ -288,7 +288,7 @@ namespace MWBase
|
||||||
|
|
||||||
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0;
|
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0;
|
||||||
virtual bool isSwimming(const MWWorld::Ptr &object) const = 0;
|
virtual bool isSwimming(const MWWorld::Ptr &object) const = 0;
|
||||||
virtual bool isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos) const = 0;
|
virtual bool isUnderwater(const MWWorld::Ptr::CellStore* cell, const Ogre::Vector3 &pos) const = 0;
|
||||||
virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0;
|
virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0;
|
||||||
|
|
||||||
virtual void togglePOV() = 0;
|
virtual void togglePOV() = 0;
|
||||||
|
|
|
@ -381,7 +381,7 @@ void RenderingManager::update (float duration, bool paused)
|
||||||
|
|
||||||
mWater->updateUnderwater(
|
mWater->updateUnderwater(
|
||||||
world->isUnderwater(
|
world->isUnderwater(
|
||||||
*world->getPlayer().getPlayer().getCell()->mCell,
|
world->getPlayer().getPlayer().getCell(),
|
||||||
Ogre::Vector3(cam.x, -cam.z, cam.y))
|
Ogre::Vector3(cam.x, -cam.z, cam.y))
|
||||||
);
|
);
|
||||||
mWater->update(duration);
|
mWater->update(duration);
|
||||||
|
|
|
@ -832,17 +832,17 @@ namespace MWWorld
|
||||||
rot.y = Ogre::Degree(y).valueRadians();
|
rot.y = Ogre::Degree(y).valueRadians();
|
||||||
rot.z = Ogre::Degree(z).valueRadians();
|
rot.z = Ogre::Degree(z).valueRadians();
|
||||||
|
|
||||||
float *objRot = ptr.getRefData().getPosition().rot;
|
if (mRendering->rotateObject(ptr, rot, adjust))
|
||||||
if(ptr.getRefData().getBaseNode() == 0 || !mRendering->rotateObject(ptr, rot, adjust))
|
|
||||||
{
|
{
|
||||||
objRot[0] = (adjust ? objRot[0] + rot.x : rot.x), objRot[1] = (adjust ? objRot[1] + rot.y : rot.y), objRot[2] = (adjust ? objRot[2] + rot.z : rot.z);
|
// rotate physically iff renderer confirm so
|
||||||
return;
|
float *objRot = ptr.getRefData().getPosition().rot;
|
||||||
}
|
|
||||||
|
|
||||||
// do this after rendering rotated the object so it gets changed by Class->adjustRotation
|
|
||||||
objRot[0] = rot.x, objRot[1] = rot.y, objRot[2] = rot.z;
|
objRot[0] = rot.x, objRot[1] = rot.y, objRot[2] = rot.z;
|
||||||
|
|
||||||
|
if (ptr.getRefData().getBaseNode() != 0) {
|
||||||
mPhysics->rotateObject(ptr);
|
mPhysics->rotateObject(ptr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
|
@ -1411,16 +1411,16 @@ namespace MWWorld
|
||||||
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(object.getRefData().getHandle());
|
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(object.getRefData().getHandle());
|
||||||
if(actor) pos.z += actor->getHalfExtents().z * 1.5;
|
if(actor) pos.z += actor->getHalfExtents().z * 1.5;
|
||||||
|
|
||||||
return isUnderwater(*object.getCell()->mCell, pos);
|
return isUnderwater(object.getCell(), pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
World::isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos) const
|
World::isUnderwater(const MWWorld::Ptr::CellStore* cell, const Ogre::Vector3 &pos) const
|
||||||
{
|
{
|
||||||
if (!(cell.mData.mFlags & ESM::Cell::HasWater)) {
|
if (!(cell->mCell->mData.mFlags & ESM::Cell::HasWater)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return pos.z < cell.mWater;
|
return pos.z < cell->mWaterLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::isOnGround(const MWWorld::Ptr &ptr) const
|
bool World::isOnGround(const MWWorld::Ptr &ptr) const
|
||||||
|
@ -1448,7 +1448,7 @@ namespace MWWorld
|
||||||
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
Ogre::Vector3 playerPos(refdata.getPosition().pos);
|
||||||
|
|
||||||
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
const OEngine::Physic::PhysicActor *physactor = mPhysEngine->getCharacter(refdata.getHandle());
|
||||||
if(!physactor->getOnGround() || isUnderwater(*currentCell->mCell, playerPos))
|
if(!physactor->getOnGround() || isUnderwater(currentCell, playerPos))
|
||||||
return 2;
|
return 2;
|
||||||
if((currentCell->mCell->mData.mFlags&ESM::Cell::NoSleep))
|
if((currentCell->mCell->mData.mFlags&ESM::Cell::NoSleep))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -316,7 +316,7 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual bool isFlying(const MWWorld::Ptr &ptr) const;
|
virtual bool isFlying(const MWWorld::Ptr &ptr) const;
|
||||||
virtual bool isSwimming(const MWWorld::Ptr &object) const;
|
virtual bool isSwimming(const MWWorld::Ptr &object) const;
|
||||||
virtual bool isUnderwater(const ESM::Cell &cell, const Ogre::Vector3 &pos) const;
|
virtual bool isUnderwater(const MWWorld::Ptr::CellStore* cell, const Ogre::Vector3 &pos) const;
|
||||||
virtual bool isOnGround(const MWWorld::Ptr &ptr) const;
|
virtual bool isOnGround(const MWWorld::Ptr &ptr) const;
|
||||||
|
|
||||||
virtual void togglePOV() {
|
virtual void togglePOV() {
|
||||||
|
|
|
@ -45,7 +45,10 @@ namespace Compiler
|
||||||
reportWarning ("Names for script " + mName + " do not match", loc);
|
reportWarning ("Names for script " + mName + " do not match", loc);
|
||||||
|
|
||||||
mState = EndCompleteState;
|
mState = EndCompleteState;
|
||||||
return true;
|
return false; // we are stopping here, because there might be more garbage on the end line,
|
||||||
|
// that we must ignore.
|
||||||
|
//
|
||||||
|
/// \todo allow this workaround to be disabled for newer scripts
|
||||||
}
|
}
|
||||||
|
|
||||||
return Parser::parseName (name, loc, scanner);
|
return Parser::parseName (name, loc, scanner);
|
||||||
|
|
Loading…
Reference in a new issue