aboutsummaryrefslogtreecommitdiff
path: root/src/shared/vmap/VMapManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/vmap/VMapManager.cpp')
-rw-r--r--src/shared/vmap/VMapManager.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/shared/vmap/VMapManager.cpp b/src/shared/vmap/VMapManager.cpp
index a059f267f2e..655bd77abfc 100644
--- a/src/shared/vmap/VMapManager.cpp
+++ b/src/shared/vmap/VMapManager.cpp
@@ -450,14 +450,14 @@ namespace VMAP
*/
//int gGetHeightCounter = 0;
- float VMapManager::getHeight(unsigned int pMapId, float x, float y, float z)
+ float VMapManager::getHeight(unsigned int pMapId, float x, float y, float z, float ray_lenght)
{
float height = VMAP_INVALID_HEIGHT_VALUE; //no height
if(isHeightCalcEnabled() && iInstanceMapTrees.containsKey(pMapId))
{
Vector3 pos = convertPositionToInternalRep(x,y,z);
MapTree* mapTree = iInstanceMapTrees.get(pMapId);
- height = mapTree->getHeight(pos);
+ height = mapTree->getHeight(pos, ray_lenght);
if(!(height < inf()))
{
height = VMAP_INVALID_HEIGHT_VALUE; //no height
@@ -633,13 +633,12 @@ namespace VMAP
//=========================================================
- float MapTree::getHeight(const Vector3& pPos)
+ float MapTree::getHeight(const Vector3& pPos, float ray_lenght)
{
float height = inf();
Vector3 dir = Vector3(0,-1,0);
Ray ray = Ray::fromOriginAndDirection(pPos, dir); // direction with length of 1
- float maxDist = VMapDefinitions::getMaxCanFallDistance();
- float dist = getIntersectionTime(ray, maxDist, false);
+ float dist = getIntersectionTime(ray, ray_lenght, false);
if(dist < inf())
{
height = (pPos + dir * dist).y;