Regular API function

simGetClosestPosOnPath / sim.getClosestPosOnPath

Description Returns the position or distance along a path that is closest to a specified point in space. See also the other path related functions.
C synopsis
float simGetClosestPosOnPath(const simFloat* path,simInt pathSize,const simFloat* pathLengths,const simFloat* absPt)
C parameters
path: the path, specified in row-major order, with x/y/z values for each path point
pathSize: the size/length of the path pointer
pathLengths: the lengths of a path. Each path point should have a corresponding length value (as the distance from the path's first point, along the path). See also sim.getPathLengths.
absPt: a point in 3D space
C return value
The position/distance along the path
Lua synopsis float posAlongPath=sim.getClosestPosOnPath(table[] path,table[] pathLengths,table[3] absPt)
Lua parameters Similar to the C-function counterpart
Lua return values Similar to the C-function counterpart