If you set t not linearly like I suggested:
This then sets the 24 correctly and the total length of the path is still correct. However it then becomes not smooth at later points in the path.
Code Select
if (pth->smooth)
t = sqrt((position - ppi->first) * pth->total_length/double(pth->pointarray[ppi->second].length));
else
t = (position - ppi->first) * pth->total_length / double(pth->pointarray[ppi->second].length);This then sets the 24 correctly and the total length of the path is still correct. However it then becomes not smooth at later points in the path.