path_get_direction(ind,pos)

From ENIGMA
Jump to navigation Jump to search

Description

Gets the path direction at the given position for the given path and returns the result. The start position of the path is 0 and the end position of the path is 1. It is always pointing from the smaller position to larger. So if the desired direction is reversed, then the 180 must be subtracted from the returned value.

Parameters

Parameter Data Type Description
ind unsigned index of the path asset
pos double position in the path (fraction between 0 and 1)

Return Values

double: Returns the direction of the given position within the path.

Example Call

// demonstrates getting the direction of the position halfway though a path
var dir;
dir = path_get_direction(mypath, 0.5);