Skip to main content
Find Spline index         Find the index of a point on a spline

Note: This only works if the spline nodes are evenly spaced (if not this could help: Equal Length Spline).

Copy to clipboard
int getIndex(Ogre::SimpleSpline* theSpline, float splinePosition) { return floor(splinePosition * (float)theSpline->getNumPoints()); }