Route objects can be created by either linking an existing Path asset (kManualPath) or can be directly computed using the Navigation data attached the Scene where the Object resides (kPathfinding).
See Also
Static Variables
Variables
Functions
Name | Description |
SetPath | Set a Path of predefined control points. |
Declaration void SetPath( Path *path ) Parameters
path : Reference to an existing Path Asset; set to nil to remove an existing Path connection.
|
BuildPath | Evaluate new Route control points based on active Pathfinding settings. |
Declaration Return Value
false if the curret RouteType is not kPathfinding or if not Map have been specified; else return true if actual control points have been generated.
|
GetClosestPoint | Return the closes point on the Route. |
Declaration MapPoint GetClosestPoint( const vec3 location ) Parameters
location : An arbitraty point in world space coordinate.
Return Value
On success a filled MapPoint structure; upon failure the flags parameter will be set to -1.
|
GetClosestPointIndex | Evaluate new Route control points based on active Pathfinding settings. |
Declaration int GetClosestPointIndex( const vec3 location ) Parameters
location : An arbitrary point in world space coordinate.
Return Value
-1 if no closests point can be found; else return the internal index of the closests MapPoint.
|
Evaluate | Return a relative point on the Route based on a specific time. |
Declaration MapPoint Evaluate( const float total_time, const float playback_time ) Parameters
total_time : Total time to travel the current Route.
playback_time : The current playback time that should be use to interpolate the returning MapPoint.
Return Value
On success a filled MapPoint structure; upon failure the flags parameter will be set to -1.
|
GetPointAt | Retrieve a specific point on the Route by index. |
Declaration MapPoint GetPointAt( unsigned short index ) Parameters
index : An arbitrary point in world space coordinate.
Return Value
On failure the flags parameter of the MapPoint structure will be set -1 (if the index is invalid); else return the MapPoint coordinates for the index specified.
|
GetPointCount | Return the current amount of control point stored for the active Route. |
Declaration unsigned short GetPointCount( void ) Return Value
Total amount of current control points maintained by the active Route.
|
GetLength | Return the total length of the active Route. |
Declaration float GetLength( bool update ) Parameters
update : Force the length to be recalculated; instead return the last length evaluated.
Return Value
The total length calculated by accumulating the distance from control point to control point.
- Note
- Take note that the underlying Object world transformation is taken in consideration while calculating the length of the Route.
|
SelectPointAt | Control the selection state of a single point on the active Route. |
Declaration bool SelectPointAt( const unsigned short index, bool selected ) Parameters
index : Index of the point to operate on.
selected : Determine the selection state of the point at index .
Return Value
true if the point at index have been selected or deselected successfully; false if the index is out of range.
|
IsPointSelected | Return the active selection state of a single point. |
Declaration int IsPointSelected( const unsigned short index ) Parameters
index : Index of the point to operate on.
Return Value
0 if the point is unselected, 1 if the point is currently selected and -1 if the point index is out or range.
|
SetPointAt | Change the current location of a point on the active Route. |
Declaration bool SetPointAt( const unsigned short index, const vec3 location ) Parameters
index : Index of the point to operate on.
location : The new location to apply to the point in space.
Return Value
true if the point at index have been updated successfully; else return false if the index is invalid.
- Note
- Changing a point location will not modify its sequence in the Route.
</td>
|
Pathfinding
Settings available when the RouteType is set to kPathfinding
. Remember to call the BuildPath
function to rebuild the control points data based on the new settings.
Variables
Name | Description |
map | Unique id of an existing Map that will be use to build the Route. |
Declaration
|
target | Unique id of an existing Object to use as target. |
Declaration - Note
- If the
target is set to 0 the system will use them end_point instead.
|
end_point | The end point to use to rebuild the Route. |
Declaration
|
target | Active distance between the Route pivot and the end point. |
Declaration - Note
- The distance is the actual distance between either the
target pivot point, if target not set to 0 ; else the end_point .
|
ability_mask | Bit mask of Ability caps that should be use for the pathfinding query. |
Declaration
|
max_points | Control the maximum limit of control points that should be generated by the pathfinding query. |
Declaration unsigned short max_points
|
option | Bit mask of MapPathOption to use for the pathfinding query. |
Declaration
|
flags | Bitmask of PathfindingOptions affecting both the behavior and construction of the Path. |
Declaration
|
option | Frequency rate the MapPath will be re-evaluated. |
Declaration
|
RouteType
Available types of Route.
kManualPath
: Use a Path Asset to define the Route control points.
kPathfinding
: Dynamic path generated from a predefined Map.
PathfindingOptions
Available options when the Route type is set to kPathfinding
.
fConnectionUpdate
: Recaculate the MapPath upon Connection changes.
fObstacleUpdate
: Recaculate the MapPath is an Obstacle have been updated, added or removed.
fZoneUpdate
: Re-evaluate the MapPath is any changes are applied on Zone.
fStitchPath
:Force the pathfinding query to stitch junctions controls points allowing the query to travel multiple Map.
fSmoothPath
:Create a smooth Bezier curves using the path resulting control points; else the path will be linear.