Find Spline index

From Ogre Wiki

Jump to: navigation, search

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

int getIndex(Ogre::SimpleSpline* theSpline, float splinePosition)
{
    return floor(splinePosition * (float)theSpline->getNumPoints());
}
Personal tools
administration