
simGetPositionOnPath / sim.getPositionOnPath
Description
|
Retrieves the absolute interpolated position of a point along a path object. See also sim.getOrientationOnPath, sim.getDataOnPath, sim.getPathPosition and sim.getClosestPositionOnPath.
|
C synopsis
|
simInt simGetPositionOnPath(simInt pathHandle,simFloat relativeDistance,simFloat* position)
|
C parameters |
pathHandle: handle of the path object
relativeDistance: a value between 0 and 1, where 0 is the beginning of the path, and 1 the end of the path. Make sure you selected the appropriate path length calculation method. See also simGetPathLength. In order to retrieve the position that lies exactly on a specific path control point, specify following for relativeDistance: -ctrlPtIndex-1 (the value will be rounded appropriately).
position: pointer to 3 values (x, y and z)
|
C return value
|
-1 if operation was not successful. In a future release, a more differentiated return value might be available
|
Lua synopsis
|
table_3 position=sim.getPositionOnPath (number pathHandle,number relativeDistance)
|
Lua parameters |
pathHandle: handle of the path object
relativeDistance: a value between 0 and 1, where 0 is the beginning of the path, and 1 the end of the path. Make sure you selected the appropriate path length calculation method. See also sim.getPathLength. In order to retrieve the position that lies exactly on a specific path control point, specify following for relativeDistance: -ctrlPtIndex-1 (the value will be rounded appropriately).
|
Lua return values
|
position: table of 3 values (x, y and z) or nil in case of an error
|
All regular API functions on one page
|