Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.Navigator Class Reference

Navigator. More...

Inheritance diagram for Dragengine.Scenery.Navigator:

Public Member Functions

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

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.

References getTypeCostPerMeter(), setTypeCostPerMeter(), and setTypeFixCost().

Referenced by lineCollide().

◆ getBlockingCost()

float Dragengine.Scenery.Navigator.getBlockingCost ( )

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

Referenced by getTypeCostPerMeter().

◆ getDefaultCostPerMeter()

float Dragengine.Scenery.Navigator.getDefaultCostPerMeter ( )

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

Referenced by setBlockingCost().

◆ getDefaultFixCost()

float Dragengine.Scenery.Navigator.getDefaultFixCost ( )

Fix cost to use if no matching type is found.

Referenced by setDefaultCostPerMeter().

◆ getLayer()

int Dragengine.Scenery.Navigator.getLayer ( )

Layer number.

References getLayer().

Referenced by getLayer().

◆ 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 .

Referenced by setMaxOutsideDistance().

◆ getSpaceType()

NavigationSpaceType Dragengine.Scenery.Navigator.getSpaceType ( )

Space type to navigate.

References setLayer().

Referenced by setSpaceType().

◆ getTypeCostPerMeter()

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

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

References getBlockingCost().

Referenced by findPath().

◆ getTypeFixCost()

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

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

Referenced by removeAllTypes().

◆ 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.

References findPath().

Referenced by pathCollideShape().

◆ 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.

References removeAllTypes(), and removeType().

Referenced by pathCollideRay().

◆ new()

Navigator Dragengine.Scenery.Navigator.new ( )

Create navigator.

References new().

Referenced by new().

◆ 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.

References nearestPoint().

Referenced by pathCollideShape(), and pathCollideShape().

◆ 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.

References lineCollide(), and pathCollideRay().

Referenced by pathCollideShape().

◆ 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.

References pathCollideRay(), and pathCollideShape().

◆ removeAllTypes()

void Dragengine.Scenery.Navigator.removeAllTypes ( )

Remove all types.

References getTypeFixCost().

Referenced by nearestPoint().

◆ removeType()

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

Remove type.

References setBlockingCost().

Referenced by nearestPoint().

◆ setBlockingCost()

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

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

References getDefaultCostPerMeter(), and setDefaultFixCost().

Referenced by removeType().

◆ setDefaultCostPerMeter()

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

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

References getDefaultFixCost().

Referenced by setTypeFixCost().

◆ setDefaultFixCost()

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

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

References setMaxOutsideDistance().

Referenced by setBlockingCost().

◆ setLayer()

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

Set layer number.

Referenced by getSpaceType().

◆ 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.

References getMaxOutsideDistance().

Referenced by setDefaultFixCost().

◆ setSpaceType()

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

Set space type to navigate.

References getSpaceType(), and setSpaceType().

Referenced by setSpaceType().

◆ setTypeCostPerMeter()

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

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

Referenced by findPath().

◆ setTypeFixCost()

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

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

References setDefaultCostPerMeter().

Referenced by findPath().


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