|
Drag[en]gine Script Module DragonScript 1.35
|
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. | |
Navigator path.
This is a native class.
| void Dragengine.Scenery.NavigatorPath.add | ( | DVector | point | ) |
Add path point to end of path.
Referenced by addPath().
| void Dragengine.Scenery.NavigatorPath.addPath | ( | NavigatorPath | path | ) |
| DVector Dragengine.Scenery.NavigatorPath.getAt | ( | int | index | ) |
| int Dragengine.Scenery.NavigatorPath.getCount | ( | ) |
| 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().
| float Dragengine.Scenery.NavigatorPath.getLengthBetween | ( | int | startIndex, |
| int | endIndex ) |
Length in meters between two points by index.
| deeOutOfBoundary | startIndex is less than 0 or greater than or equal to getPointCount(). |
| deeOutOfBoundary | endIndex is less than startIndex or greater than or equal to getPointCount(). |
References getLengthTo().
Referenced by writeToFile().
| float Dragengine.Scenery.NavigatorPath.getLengthFrom | ( | int | startIndex | ) |
Length in meters from point at index to end of path.
| deeOutOfBoundary | startIndex is less than 0 or greater than or equal to getPointCount(). |
References getLength().
Referenced by writeToFile().
| float Dragengine.Scenery.NavigatorPath.getLengthTo | ( | int | endIndex | ) |
Length in meters from start of path to point at index.
| deeOutOfBoundary | endIndex is less than 0 or greater than or equal to getPointCount(). |
Referenced by getLengthBetween().
| NavigatorPath Dragengine.Scenery.NavigatorPath.new | ( | ) |
| NavigatorPath Dragengine.Scenery.NavigatorPath.new | ( | NavigatorPath | path | ) |
Create copy of navigator path.
References new().
|
static |
Read path from file reader.
Referenced by updateDebugDrawer().
| void Dragengine.Scenery.NavigatorPath.removeAll | ( | ) |
Remove all path points.
Referenced by transformed().
| void Dragengine.Scenery.NavigatorPath.removeFrom | ( | int | index | ) |
Remove path point at index.
| deeOutOfBoundary | index is less than 0 or greater than or equal to GetPointCount(). |
References addPath().
Referenced by transformed().
| void Dragengine.Scenery.NavigatorPath.setAt | ( | int | index, |
| DVector | point ) |
Set path point at index.
| deeOutOfBoundary | index is less than 0 or greater than or equal to getPointCount(). |
Referenced by addPath().
| void Dragengine.Scenery.NavigatorPath.transform | ( | DMatrix | matrix | ) |
Transform all points by matrix.
Referenced by getLength().
| NavigatorPath Dragengine.Scenery.NavigatorPath.transformed | ( | DMatrix | matrix | ) |
New path with points transformed by matrix.
References removeAll(), and removeFrom().
Referenced by getLength().
| 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().
| void Dragengine.Scenery.NavigatorPath.writeToFile | ( | FileWriter | writer | ) |
Write path to file writer.
References getLengthBetween(), and getLengthFrom().
Referenced by updateDebugDrawer().