VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions
DtPersistentPointAlongHeadingQuery Class Referenceabstract

Test class for providing a fast way for an entity to "walk" along the nav mesh. This is the abstract base class.

Public Types

enum  RestrictionMode { StayOnPedestrianPathsMode = 0, StayOffRoadsMode = 1 }
 
enum  RayCastQueryResult {
  RAYCAST_NOT_INITIALIZED = 0, RAYCAST_NOT_PROCESSED = 1, RAYCAST_DONE_START_OUTSIDE, RAYCAST_DONE_START_NAVTAG_FORBIDDEN,
  RAYCAST_DONE_CANNOT_MOVE, RAYCAST_DONE_COLLISION_FOUND_ARRIVAL_ERROR, RAYCAST_DONE_LACK_OF_WORKING_MEMORY, RAYCAST_DONE_QUERY_TOO_LONG,
  RAYCAST_DONE_UNKNOWN_ERROR, RAYCAST_DONE_ARRIVALPOS_FOUND_MAXDIST_REACHED, RAYCAST_DONE_ARRIVALPOS_FOUND_WITH_COLLISION, RAYCAST_DONE_ARRIVALPOS_FOUND_AFTER_COLLISION = RAYCAST_DONE_ARRIVALPOS_FOUND_WITH_COLLISION
}
 

Public Member Functions

 DtPersistentPointAlongHeadingQuery ()
 
virtual ~DtPersistentPointAlongHeadingQuery ()
 
virtual void setRestriction (RestrictionMode r)=0
 
virtual RestrictionMode restriction ()=0
 
virtual bool findFarthestPositionAlongHeading (const DtVector &start, double heading, double maxDistance, DtVector &result, bool &collidedWithEdge, double &horizontalDistance)=0
 
virtual bool findFarthestNavPositionAlongHeading (const DtVector &navStart, double heading, double maxDistance, DtVector &navResult, bool &collidedWithEdge, double &horizontalDistance)=0
 
virtual int numIntermediatePoints ()=0
 
virtual DtVector intermediatePoint (int index)=0
 
virtual RayCastQueryResult detailedResult ()=0
 
virtual bool farthestPointOnLine (DtVector &navResult, double &distance)=0
 

Member Enumeration Documentation

Enumerator
StayOnPedestrianPathsMode 
StayOffRoadsMode 
Enumerator
RAYCAST_NOT_INITIALIZED 

Indicates that the query has not yet been initialized.

RAYCAST_NOT_PROCESSED 

Indicates that the query has not yet been launched.

RAYCAST_DONE_START_OUTSIDE 

Indicates that a NavMesh triangle could not be found for the starting point.

RAYCAST_DONE_START_NAVTAG_FORBIDDEN 

Indicates that a NavMesh triangle has been found for the starting point, but its NavTag is not considered navigable.

RAYCAST_DONE_CANNOT_MOVE 

Indicates that the starting point is very close to a NavMesh border, such that moving back the collision point resulted in an arrival position that is behind the starting point.

RAYCAST_DONE_COLLISION_FOUND_ARRIVAL_ERROR 

Indicates that a collision point was found, but moving back from that point resulted in an arrival position that could not be snapped to the NavMesh grid.

RAYCAST_DONE_LACK_OF_WORKING_MEMORY 

Indicates that insufficient memory was available to store crossed triangles or sub-sections, and the query failed as a result.

RAYCAST_DONE_QUERY_TOO_LONG 

Indicates that the query was not performed, because the value of BaseRayCastQuery::m_maxDist is large enough to cause a potential integer overflow during the computation. Retry your query with a smaller maximum distance.

RAYCAST_DONE_UNKNOWN_ERROR 

Indicates that an unknown error occurred during the query processing.

RAYCAST_DONE_ARRIVALPOS_FOUND_MAXDIST_REACHED 

Indicates that the ray was able to travel its maximum distance without collision.

RAYCAST_DONE_ARRIVALPOS_FOUND_WITH_COLLISION 

Indicates that a collision point was found and that a final arrival position was calculated successfully.

RAYCAST_DONE_ARRIVALPOS_FOUND_AFTER_COLLISION 

weird name kept for backward compatibility

Constructor & Destructor Documentation

DtPersistentPointAlongHeadingQuery::DtPersistentPointAlongHeadingQuery ( )
inline
virtual DtPersistentPointAlongHeadingQuery::~DtPersistentPointAlongHeadingQuery ( )
inlinevirtual

Member Function Documentation

virtual void DtPersistentPointAlongHeadingQuery::setRestriction ( RestrictionMode  r)
pure virtual
virtual RestrictionMode DtPersistentPointAlongHeadingQuery::restriction ( )
pure virtual
virtual bool DtPersistentPointAlongHeadingQuery::findFarthestPositionAlongHeading ( const DtVector start,
double  heading,
double  maxDistance,
DtVector result,
bool collidedWithEdge,
double horizontalDistance 
)
pure virtual

Runs the query. Note that the boolean return value collidedWithEdge is the opposite of the primitive Gameware farthestPointAlongHeading query, which returns reachedMaxDistance. HorizontalDistance is the distance in the xy plane to the result.

virtual bool DtPersistentPointAlongHeadingQuery::findFarthestNavPositionAlongHeading ( const DtVector navStart,
double  heading,
double  maxDistance,
DtVector navResult,
bool collidedWithEdge,
double horizontalDistance 
)
pure virtual

Same function as above, but the parameters navStart and navResult are in nav mesh coordinates.

virtual int DtPersistentPointAlongHeadingQuery::numIntermediatePoints ( )
pure virtual

Get extra results from last run query.

virtual DtVector DtPersistentPointAlongHeadingQuery::intermediatePoint ( int  index)
pure virtual
virtual RayCastQueryResult DtPersistentPointAlongHeadingQuery::detailedResult ( )
pure virtual
virtual bool DtPersistentPointAlongHeadingQuery::farthestPointOnLine ( DtVector navResult,
double distance 
)
pure virtual

Based on intermediate points from the last performed query, find the farthest intermediate point which is on the same 3D line as previous points. This means that as soon a slope change occurs in the result, the last point before the slope change is the result. navResult is in nav mesh coordinates.


The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)