Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.Navigator Class Reference

Navigator. More...

Inheritance diagram for Dragengine.Scenery.Navigator:

Public Member Functions

Constructors
Navigator new ()
 Create navigator. More...
 
Management
int getLayer ()
 Layer number. More...
 
void setLayer (int layer)
 Set layer number. More...
 
NavigationSpaceType getSpaceType ()
 Space type to navigate. More...
 
void setSpaceType (NavigationSpaceType spaceType)
 Set space type to navigate. More...
 
float getMaxOutsideDistance ()
 Maximum distance the start and goal point are allowed to be outside any navigation space. More...
 
void setMaxOutsideDistance (float maxDistance)
 Set maximum distance the start and goal point are allowed to be outside any navigation space. More...
 
float getDefaultFixCost ()
 Fix cost to use if no matching type is found. More...
 
void setDefaultFixCost (float cost)
 Set fix cost to use if no matching type is found. More...
 
float getDefaultCostPerMeter ()
 Cost per meter to use if no matching type is found. More...
 
void setDefaultCostPerMeter (float costPerMeter)
 Set cost per meter to use if no matching type is found. More...
 
float getBlockingCost ()
 Maximum cost beyond which a node or path is considered impassable. More...
 
void setBlockingCost (float cost)
 Set maximum cost beyond which a node or path is considered impassable. More...
 
float getTypeFixCost (int type)
 Fix cost for type or default fix cost if not found. More...
 
void setTypeFixCost (int type, float fixCost)
 Set fix cost for type or default fix cost if not found. More...
 
float getTypeCostPerMeter (int type)
 Cost per meter for type or default cost per meter if not found. More...
 
void setTypeCostPerMeter (int type, float costPerMeter)
 Set cost per meter for type or default cost per meter if not found. More...
 
void removeType (int type)
 Remove type. More...
 
void removeAllTypes ()
 Remove all types. More...
 
void findPath (NavigatorPath path, DVector start, DVector goal)
 Find path. More...
 
NavigationInfo nearestPoint (DVector point, float radius)
 Nearest point on nearest navigation space. More...
 
NavigationInfo lineCollide (DVector origin, Vector direction)
 Distance moving from point along direction before crossing navigation space boundaries. More...
 
NavigationInfo pathCollideRay (NavigatorPath path, Collider collider)
 Test path for collision using ray test against collider. More...
 
NavigationInfo pathCollideRay (NavigatorPath path, Collider collider, DVector startPosition, int nextPoint, float maxDistance)
 Test path for collision using ray test against collider inside range. More...
 
NavigationInfo pathCollideShape (NavigatorPath path, Collider collider, Collider agent)
 Test path for collision using an agent collider moved along the path against a collider. More...
 
NavigationInfo pathCollideShape (NavigatorPath path, Collider collider, Collider agent, DVector startPosition, int nextPoint, float maxDistance)
 Test path for collision using an agent collider moved along the path against a collider inside range. More...
 

Detailed Description

Navigator.

This is a native class.

Member Function Documentation

◆ findPath()

void Dragengine.Scenery.Navigator.findPath ( NavigatorPath  path,
DVector  start,
DVector  goal 
)

Find path.

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

◆ getBlockingCost()

float Dragengine.Scenery.Navigator.getBlockingCost ( )

Maximum cost beyond which a node or path is considered impassable.

◆ getDefaultCostPerMeter()

float Dragengine.Scenery.Navigator.getDefaultCostPerMeter ( )

Cost per meter to use if no matching type is found.

◆ getDefaultFixCost()

float Dragengine.Scenery.Navigator.getDefaultFixCost ( )

Fix cost to use if no matching type is found.

◆ getLayer()

int Dragengine.Scenery.Navigator.getLayer ( )

Layer number.

◆ getMaxOutsideDistance()

float Dragengine.Scenery.Navigator.getMaxOutsideDistance ( )

Maximum distance the start and goal point are allowed to be outside any navigation space.

If the start or goal point is outside the range path update returns an empty path. The default disstance is 0.5m .

◆ getSpaceType()

NavigationSpaceType Dragengine.Scenery.Navigator.getSpaceType ( )

Space type to navigate.

◆ getTypeCostPerMeter()

float Dragengine.Scenery.Navigator.getTypeCostPerMeter ( int  type)

Cost per meter for type or default cost per meter if not found.

◆ getTypeFixCost()

float Dragengine.Scenery.Navigator.getTypeFixCost ( int  type)

Fix cost for type or default fix cost if not found.

◆ lineCollide()

NavigationInfo Dragengine.Scenery.Navigator.lineCollide ( DVector  origin,
Vector  direction 
)

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

Parameters
originOrigin to start moving. Use NearestPoint() to make sure it is located on a navigation space.
directionDirection to move starting at origin.
Returns
navigation information if navigation space boundary is touched before end of direction is reached. If no border is touched null is returned. Null is also returned if origin is not located in the navigation space. In the returned NavigationInfo object the following parameter are set:
  • getPathFactor() to get the percentage distance along direction (0 to 1).
  • getPosition() to get position of hit point at navigation space boundary.

◆ nearestPoint()

NavigationInfo Dragengine.Scenery.Navigator.nearestPoint ( DVector  point,
float  radius 
)

Nearest point on nearest navigation space.

Parameters
pointPoint to find nearest point for.
radiusMaximum radius clamped to 0 or larger to find nearest point in.
Returns
Nearest point (sets position, costType) if found or null if not found.

◆ new()

Navigator Dragengine.Scenery.Navigator.new ( )

Create navigator.

◆ pathCollideRay() [1/2]

NavigationInfo Dragengine.Scenery.Navigator.pathCollideRay ( NavigatorPath  path,
Collider  collider 
)

Test path for collision using ray test against collider.

Returns
Navigation info (sets pathIndex, pathFactor) or null if not collision is found.

◆ pathCollideRay() [2/2]

NavigationInfo Dragengine.Scenery.Navigator.pathCollideRay ( NavigatorPath  path,
Collider  collider,
DVector  startPosition,
int  nextPoint,
float  maxDistance 
)

Test path for collision using ray test against collider inside range.

Parameters
pathPath to use.
colliderCollider to use for testing.
startPositionStarting position for testing.
nextPointIndex of next point along the path to test. If this is equal to getPathPointCount() the goal position is used.
maxDistanceLimit testing to maxDistance meters after startPosition along path.
Exceptions
EOutOfBoundarynextPoint is less than 0 or larger than getPathPointCount().
Returns
Navigation info (sets pathIndex, pathFactor) or null if not collision is found.

◆ pathCollideShape() [1/2]

NavigationInfo Dragengine.Scenery.Navigator.pathCollideShape ( NavigatorPath  path,
Collider  collider,
Collider  agent 
)

Test path for collision using an agent collider moved along the path against a collider.

Returns
Navigation info (sets pathIndex, pathFactor) or null if not collision is found.

◆ pathCollideShape() [2/2]

NavigationInfo Dragengine.Scenery.Navigator.pathCollideShape ( NavigatorPath  path,
Collider  collider,
Collider  agent,
DVector  startPosition,
int  nextPoint,
float  maxDistance 
)

Test path for collision using an agent collider moved along the path against a collider inside range.

Parameters
pathPath to use.
colliderCollider to use for testing.
agentCollider representing the agent.
startPositionStarting position for testing.
nextPointIndex of next point along the path to test. If this is equal to getPathPointCount() the goal position is used.
maxDistanceLimit testing to maxDistance meters after startPosition along path.
Exceptions
EOutOfBoundarynextPoint is less than 0 or larger than getPathPointCount().
Returns
Navigation info (sets pathIndex, pathFactor) or null if not collision is found.

◆ removeAllTypes()

void Dragengine.Scenery.Navigator.removeAllTypes ( )

Remove all types.

◆ removeType()

void Dragengine.Scenery.Navigator.removeType ( int  type)

Remove type.

◆ setBlockingCost()

void Dragengine.Scenery.Navigator.setBlockingCost ( float  cost)

Set maximum cost beyond which a node or path is considered impassable.

◆ setDefaultCostPerMeter()

void Dragengine.Scenery.Navigator.setDefaultCostPerMeter ( float  costPerMeter)

Set cost per meter to use if no matching type is found.

◆ setDefaultFixCost()

void Dragengine.Scenery.Navigator.setDefaultFixCost ( float  cost)

Set fix cost to use if no matching type is found.

◆ setLayer()

void Dragengine.Scenery.Navigator.setLayer ( int  layer)

Set layer number.

◆ setMaxOutsideDistance()

void Dragengine.Scenery.Navigator.setMaxOutsideDistance ( float  maxDistance)

Set maximum distance the start and goal point are allowed to be outside any navigation space.

If the start or goal point is outside the range path update returns an empty path.

◆ setSpaceType()

void Dragengine.Scenery.Navigator.setSpaceType ( NavigationSpaceType  spaceType)

Set space type to navigate.

◆ setTypeCostPerMeter()

void Dragengine.Scenery.Navigator.setTypeCostPerMeter ( int  type,
float  costPerMeter 
)

Set cost per meter for type or default cost per meter if not found.

◆ setTypeFixCost()

void Dragengine.Scenery.Navigator.setTypeFixCost ( int  type,
float  fixCost 
)

Set fix cost for type or default fix cost if not found.


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