Find Spline index         Find the index of a point on a spline
Print

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());
}

 


Contributors to this page: jacmoe111451 points  and Spacegaier3733 points  .
Page last modified on Saturday 02 of January, 2010 04:05:13 GMT by jacmoe111451 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.