Some terrain fixes

This commit is contained in:
scrawl 2013-08-20 12:08:46 +02:00
parent 0545622f5a
commit fa76d1631b
4 changed files with 9 additions and 9 deletions

View file

@ -1003,7 +1003,8 @@ void RenderingManager::resetCamera()
float RenderingManager::getTerrainHeightAt(Ogre::Vector3 worldPos)
{
assert(mTerrain);
if (!mTerrain || !mTerrain->getVisible())
return -std::numeric_limits<float>::max();
return mTerrain->getHeightAt(worldPos);
}

View file

@ -1027,13 +1027,10 @@ namespace MWWorld
return;
}
if (ptr.getCell()->isExterior())
{
float terrainHeight = mRendering->getTerrainHeightAt(pos);
float terrainHeight = mRendering->getTerrainHeightAt(pos);
if (pos.z < terrainHeight)
pos.z = terrainHeight;
}
if (pos.z < terrainHeight)
pos.z = terrainHeight;
ptr.getRefData().getPosition().pos[2] = pos.z + 20; // place slightly above. will snap down to ground with code below