03-15-2018, 11:34 AM
(This post was last modified: 03-15-2018, 12:41 PM by HundredTai.)
Hello,
I've been trying to extend the Spline Controller and manage all of the speed functions from there. However, when calling the Speed property in CurvyController, to set it to 0 (or anything below 1) it throwns an Index Out of Range exception. Coming from the following line in CurvySplineSegment:
I'm not quite sure what the relation is to this and why the error comes up. When adjusting the speed and setting it to zero in the Refresh function in the CurvyController there aren't any problems. Needless to say that isn't a good approach if I want to give all control to a higher class.
When looking at the examplair MotorController class it also changes the Speed property directly, but without any errors.
My goal is to gradually lower the Speed to 0.
What is the reason for the error and how should I go about properly extending the CurvyController as to where I can control its speed?
Thank you.
I've been trying to extend the Spline Controller and manage all of the speed functions from there. However, when calling the Speed property in CurvyController, to set it to 0 (or anything below 1) it throwns an Index Out of Range exception. Coming from the following line in CurvySplineSegment:
Code:
float frag = (localDistance - ApproximationDistances[lidx]) / (ApproximationDistances[lidx + 1] - ApproximationDistances[lidx]);
I'm not quite sure what the relation is to this and why the error comes up. When adjusting the speed and setting it to zero in the Refresh function in the CurvyController there aren't any problems. Needless to say that isn't a good approach if I want to give all control to a higher class.
When looking at the examplair MotorController class it also changes the Speed property directly, but without any errors.
My goal is to gradually lower the Speed to 0.
What is the reason for the error and how should I go about properly extending the CurvyController as to where I can control its speed?
Thank you.