mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-07 11:14:08 +03:00
Some terrain fixes
This commit is contained in:
parent
0545622f5a
commit
fa76d1631b
4 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue