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

Navigator path. More...

Inheritance diagram for Dragengine.Scenery.NavigatorPath:

Public Member Functions

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

File Handling

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

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.

Referenced by addPath().

◆ addPath()

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

Add path points to end of path.

References add(), and setAt().

Referenced by removeFrom().

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

References getAt().

Referenced by getAt().

◆ getCount()

int Dragengine.Scenery.NavigatorPath.getCount ( )

Number of points.

References getCount().

Referenced by getCount().

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

References transform(), and transformed().

Referenced by getLengthFrom().

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

References getLengthTo().

Referenced by writeToFile().

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

References getLength().

Referenced by writeToFile().

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

Referenced by getLengthBetween().

◆ new() [1/2]

NavigatorPath Dragengine.Scenery.NavigatorPath.new ( )

Create navigator path.

References new().

Referenced by new(), and new().

◆ new() [2/2]

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

Create copy of navigator path.

References new().

◆ readFromFile()

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

Read path from file reader.

Referenced by updateDebugDrawer().

◆ removeAll()

void Dragengine.Scenery.NavigatorPath.removeAll ( )

Remove all path points.

Referenced by transformed().

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

References addPath().

Referenced by transformed().

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

Referenced by addPath().

◆ transform()

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

Transform all points by matrix.

Referenced by getLength().

◆ transformed()

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

New path with points transformed by matrix.

References removeAll(), and removeFrom().

Referenced by getLength().

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

References readFromFile(), updateDebugDrawer(), and writeToFile().

Referenced by updateDebugDrawer().

◆ writeToFile()

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

Write path to file writer.

References getLengthBetween(), and getLengthFrom().

Referenced by updateDebugDrawer().


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