Drag[en]gine Game Engine  1.21
deBaseAINavigator Class Reference

AI module navigator peer. More...

#include <deBaseAINavigator.h>

Public Member Functions

Constructors and Destructors
 deBaseAINavigator ()
 Create peer. More...
 
virtual ~deBaseAINavigator ()
 Clean up peer. More...
 
Notifications
virtual void LayerChanged ()
 Layer number changed. More...
 
virtual void SpaceTypeChanged ()
 Space type changed. More...
 
virtual void CostsChanged ()
 Costs changed. More...
 
virtual void TypesChanged ()
 Types changed. More...
 
virtual void ParametersChanged ()
 Parameters changed. More...
 
virtual bool NearestPoint (const decDVector &point, float radius, decDVector &nearestPoint, int &nearestType)
 Nearest point on nearest navigation space. More...
 
virtual bool LineCollide (const decDVector &origin, const decVector &direction, float &distance)
 Distance moving from point along direction before crossing navigation space boundaries. More...
 
virtual void FindPath (deNavigatorPath &path, const decDVector &start, const decDVector &goal)
 Find path. More...
 
virtual bool PathCollideRay (const deNavigatorPath &path, deCollider &collider, int &hitAfterPoint, float &hitDistance)
 Test path for collision using ray test. More...
 
virtual bool PathCollideRay (const deNavigatorPath &path, deCollider &collider, const decDVector &startPosition, int nextPoint, float maxDistance, int &hitAfterPoint, float &hitDistance)
 Test path for collision using ray test in range. More...
 
virtual bool PathCollideShape (const deNavigatorPath &path, deCollider &collider, deCollider &agent, int &hitAfterPoint, float &hitDistance)
 Test path for collision using a collider moved along the path. More...
 
virtual bool PathCollideShape (const deNavigatorPath &path, deCollider &collider, deCollider &agent, const decDVector &startPosition, int nextPoint, float maxDistance, int &hitAfterPoint, float &hitDistance)
 Test path for collision using a collider moved along the path in range. More...
 

Detailed Description

AI module navigator peer.

Constructor & Destructor Documentation

◆ deBaseAINavigator()

deBaseAINavigator::deBaseAINavigator ( )

Create peer.

◆ ~deBaseAINavigator()

virtual deBaseAINavigator::~deBaseAINavigator ( )
virtual

Clean up peer.

Member Function Documentation

◆ CostsChanged()

virtual void deBaseAINavigator::CostsChanged ( )
virtual

Costs changed.

◆ FindPath()

virtual void deBaseAINavigator::FindPath ( deNavigatorPath path,
const decDVector start,
const decDVector goal 
)
virtual

Find path.

Replaces path with found path. If path can not be found the path is empty.

Parameters
[out]pathPath to update.
[in]startStart position of path.
[in]goalGoal position of path.

◆ LayerChanged()

virtual void deBaseAINavigator::LayerChanged ( )
virtual

Layer number changed.

◆ LineCollide()

virtual bool deBaseAINavigator::LineCollide ( const decDVector origin,
const decVector direction,
float &  distance 
)
virtual

Distance moving from point along direction before crossing navigation space boundaries.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]originOrigin to start moving. Use NearestPoint() to make sure it is located on a navigation space.
[in]directionDirection to move starting at origin.
[out]distanceSet to the distance along displacement as percentage from 0 to 1 before touching a navigation space boundary. Set to 1 if no border is touched.
Return values
trueorigin is located in the navigation space and moving along direction a navigation space boundary is touched. distance is set to the travelled percentage of direction.
falseorigin is not located in the navigation space.
falseNo navigation space boundary is hit moving along line.

◆ NearestPoint()

virtual bool deBaseAINavigator::NearestPoint ( const decDVector point,
float  radius,
decDVector nearestPoint,
int &  nearestType 
)
virtual

Nearest point on nearest navigation space.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]pointPoint to find nearest point for.
[in]radiusMaximum radius clamped to 0 or larger to find nearest point in.
[out]nearestPointSet to the nearest point if found.
[out]nearestTypeSet to the type number of the nearest point if found.
Return values
trueNearest point is found and written to nearestPoint and nearestType.
falseNo nearest point found inside radius around point.
falseThere are no matching navigation spaces.

◆ ParametersChanged()

virtual void deBaseAINavigator::ParametersChanged ( )
virtual

Parameters changed.

◆ PathCollideRay() [1/2]

virtual bool deBaseAINavigator::PathCollideRay ( const deNavigatorPath path,
deCollider collider,
const decDVector startPosition,
int  nextPoint,
float  maxDistance,
int &  hitAfterPoint,
float &  hitDistance 
)
virtual

Test path for collision using ray test in range.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]pathPath to use for testing.
[out]hitAfterPointIndex of point after which the collision has been found.
[out]hitDistanceRelative distance from 0 to 1 along segment after hitAfterPoint.
Return values
trueif a collision is found and hitAfterPoint and hitDistance are set.
falseNo collision found.

◆ PathCollideRay() [2/2]

virtual bool deBaseAINavigator::PathCollideRay ( const deNavigatorPath path,
deCollider collider,
int &  hitAfterPoint,
float &  hitDistance 
)
virtual

Test path for collision using ray test.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]pathPath to use for testing.
[out]hitAfterPointIndex of point after which the collision has been found.
[out]hitDistanceRelative distance from 0 to 1 along segment after hitAfterPoint.
Return values
trueif a collision is found and hitAfterPoint and hitDistance are set.
falseNo collision found.

◆ PathCollideShape() [1/2]

virtual bool deBaseAINavigator::PathCollideShape ( const deNavigatorPath path,
deCollider collider,
deCollider agent,
const decDVector startPosition,
int  nextPoint,
float  maxDistance,
int &  hitAfterPoint,
float &  hitDistance 
)
virtual

Test path for collision using a collider moved along the path in range.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]pathPath to use for testing.
[out]hitAfterPointIndex of point after which the collision has been found.
[out]hitDistanceRelative distance from 0 to 1 along segment after hitAfterPoint.
Return values
trueif a collision is found and hitAfterPoint and hitDistance are set.
falseNo collision found.

◆ PathCollideShape() [2/2]

virtual bool deBaseAINavigator::PathCollideShape ( const deNavigatorPath path,
deCollider collider,
deCollider agent,
int &  hitAfterPoint,
float &  hitDistance 
)
virtual

Test path for collision using a collider moved along the path.

Default implementation returns false. AI module has to subclass this method.

Parameters
[in]pathPath to use for testing.
[out]hitAfterPointIndex of point after which the collision has been found.
[out]hitDistanceRelative distance from 0 to 1 along segment after hitAfterPoint.
Return values
trueif a collision is found and hitAfterPoint and hitDistance are set.
falseNo collision found.

◆ SpaceTypeChanged()

virtual void deBaseAINavigator::SpaceTypeChanged ( )
virtual

Space type changed.

◆ TypesChanged()

virtual void deBaseAINavigator::TypesChanged ( )
virtual

Types changed.


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