Add option for search distance to getHeight() functions and make Creature::FallGround() use VMaps properly. (Fix by Lynx3d)

This finally prevents flying creatures from falling to infinity (basically instantly diappearing) in several instances, aswell
as prevent creatures from falling inside larger solid object around the world.

--HG--
branch : trunk
This commit is contained in:
click
2010-07-27 17:29:33 +02:00
parent dbd76ef9ed
commit e5b7f6ad01
9 changed files with 14 additions and 21 deletions

View File

@@ -224,12 +224,12 @@ namespace VMAP
//=========================================================
float StaticMapTree::getHeight(const Vector3& pPos) const
float StaticMapTree::getHeight(const Vector3& pPos, float maxSearchDist) const
{
float height = G3D::inf();
Vector3 dir = Vector3(0,0,-1);
G3D::Ray ray(pPos, dir); // direction with length of 1
float maxDist = VMapDefinitions::getMaxCanFallDistance();
float maxDist = maxSearchDist;
if (getIntersectionTime(ray, maxDist, false))
{
height = pPos.z - maxDist;