Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.NavigatorPath Class Reference

Navigator path. More...

Inheritance diagram for Dragengine.Scenery.NavigatorPath:

Public Member Functions

Constructors
NavigatorPath new ()
 Create navigator path. More...
 
NavigatorPath new (NavigatorPath path)
 Create copy of navigator path. More...
 
Management
int getCount ()
 Number of points. More...
 
DVector getAt (int index)
 Path point at index. More...
 
void setAt (int index, DVector point)
 Set path point at index. More...
 
void add (DVector point)
 Add path point to end of path. More...
 
void addPath (NavigatorPath path)
 Add path points to end of path. More...
 
void removeFrom (int index)
 Remove path point at index. More...
 
void removeAll ()
 Remove all path points. More...
 
void transform (DMatrix matrix)
 Transform all points by matrix. More...
 
NavigatorPath transformed (DMatrix matrix)
 New path with points transformed by matrix. More...
 
float getLength ()
 Length in meters from start of path to the end. More...
 
float getLengthTo (int endIndex)
 Length in meters from start of path to point at index. More...
 
float getLengthFrom (int startIndex)
 Length in meters from point at index to end of path. More...
 
float getLengthBetween (int startIndex, int endIndex)
 Length in meters between two points by index. More...
 
Debugging
void updateDebugDrawer (DebugDrawer debugDrawer, int shape, float scale)
 Update DebugDrawer with path. More...
 

File Handling

void writeToFile (FileWriter writer)
 Write path to file writer. More...
 
static NavigatorPath readFromFile (FileReader reader)
 Read path from file reader. More...
 

Detailed Description

Navigator path.

This is a native class.

Member Function Documentation

◆ add()

void Dragengine.Scenery.NavigatorPath.add ( DVector  point)

Add path point to end of path.

◆ addPath()

void Dragengine.Scenery.NavigatorPath.addPath ( NavigatorPath  path)

Add path points to end of path.

◆ getAt()

DVector Dragengine.Scenery.NavigatorPath.getAt ( int  index)

Path point at index.

Exceptions
deeOutOfBoundaryindex is less than 0 or greater than or equal to getPointCount().

◆ getCount()

int Dragengine.Scenery.NavigatorPath.getCount ( )

Number of points.

◆ getLength()

float Dragengine.Scenery.NavigatorPath.getLength ( )

Length in meters from start of path to the end.

This does not include the start position used to find the path. Hence if the goal position can be reached directly the path contains only the goal position and the length is 0.

◆ getLengthBetween()

float Dragengine.Scenery.NavigatorPath.getLengthBetween ( int  startIndex,
int  endIndex 
)

Length in meters between two points by index.

Exceptions
deeOutOfBoundarystartIndex is less than 0 or greater than or equal to getPointCount().
deeOutOfBoundaryendIndex is less than startIndex or greater than or equal to getPointCount().

◆ getLengthFrom()

float Dragengine.Scenery.NavigatorPath.getLengthFrom ( int  startIndex)

Length in meters from point at index to end of path.

Exceptions
deeOutOfBoundarystartIndex is less than 0 or greater than or equal to getPointCount().

◆ getLengthTo()

float Dragengine.Scenery.NavigatorPath.getLengthTo ( int  endIndex)

Length in meters from start of path to point at index.

Exceptions
deeOutOfBoundaryendIndex is less than 0 or greater than or equal to getPointCount().

◆ new() [1/2]

NavigatorPath Dragengine.Scenery.NavigatorPath.new ( )

Create navigator path.

◆ new() [2/2]

NavigatorPath Dragengine.Scenery.NavigatorPath.new ( NavigatorPath  path)

Create copy of navigator path.

◆ readFromFile()

static NavigatorPath Dragengine.Scenery.NavigatorPath.readFromFile ( FileReader  reader)
static

Read path from file reader.

◆ removeAll()

void Dragengine.Scenery.NavigatorPath.removeAll ( )

Remove all path points.

◆ removeFrom()

void Dragengine.Scenery.NavigatorPath.removeFrom ( int  index)

Remove path point at index.

Exceptions
deeOutOfBoundaryindex is less than 0 or greater than or equal to GetPointCount().

◆ setAt()

void Dragengine.Scenery.NavigatorPath.setAt ( int  index,
DVector  point 
)

Set path point at index.

Exceptions
deeOutOfBoundaryindex is less than 0 or greater than or equal to getPointCount().

◆ transform()

void Dragengine.Scenery.NavigatorPath.transform ( DMatrix  matrix)

Transform all points by matrix.

◆ transformed()

NavigatorPath Dragengine.Scenery.NavigatorPath.transformed ( DMatrix  matrix)

New path with points transformed by matrix.

◆ updateDebugDrawer()

void Dragengine.Scenery.NavigatorPath.updateDebugDrawer ( DebugDrawer  debugDrawer,
int  shape,
float  scale 
)

Update DebugDrawer with path.

Shows a sphere at the first path point and a thin box at the last. Segments in between are thin elongated boxes. The caller is responsible to set up debug drawer and shape properties. The scaling adjusts the relative size of the generated shape content.

◆ writeToFile()

void Dragengine.Scenery.NavigatorPath.writeToFile ( FileWriter  writer)

Write path to file writer.


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