03-05-2018, 05:19 PM
I updated the image, it should be easier to understand now.
But I think I found the issue, it's here :
That should be like this :
It appears that my code added the current spline even if it was not valide and that led to the bug.
If I undestand correctly, since my code allowed the current spline to be continued, the contoller just got back to the start of the spline and given that the start point had connection, the code started again and choose the main spline, so I thought the controller teleported.
But I think I found the issue, it's here :
Code:
if (e.Spline.IsClosed || !e.ControlPoint.IsLastControlPoint) // Can continue on the same spline
{
valideControlPoints.Add(e.ControlPoint); // Add current spline
}
That should be like this :
Code:
if (e.Spline.IsClosed || (e.ControlPoint.IsLastControlPoint && Controller.Direction == -1) || (e.ControlPoint.IsFirstControlPoint && Controller.Direction == 1)) // Can continue on the same spline
{
valideControlPoints.Add(e.ControlPoint); // Add current spline
}
It appears that my code added the current spline even if it was not valide and that led to the bug.
If I undestand correctly, since my code allowed the current spline to be continued, the contoller just got back to the start of the spline and given that the start point had connection, the code started again and choose the main spline, so I thought the controller teleported.