View Single Post
  #3  
Old 09-20-2010, 01:57 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Defined in map.h/map.cpp
Code:
bool LineIntersectsZone(VERTEX start, VERTEX end, float step, VERTEX *result, FACE **on = NULL) const;
Will check if there are any obstacles in between the points defined by the start and end vertices, returning true if there is an obstacle.

I believe the result vertex is the point of collision, and the face 'on' is the triangle that was hit.

Code:
float Map::FindBestZ( NodeRef node_r, VERTEX p1, VERTEX *result, FACE **on) const
Given vertex p1, will return the 'best' Z value for that point. Basically it will cast a ray downwards from point p1 and if it intersects
something, then will return the Z of the face it intersected.

If it finds no ground beneath the given point, it will try again from 10 Z units higher up.

If you look in waypoints.cpp and pathing.cpp, you will find examples of both functions in use.
Reply With Quote