Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] SplineController skips on CurvySpline.ControlPoints[0].Delete()
#2
Yeah, this is glitch that will be handled in the 2.0.5 update. AdaptOnChange does not handle deletion of CP's properly.

To help you understand what's going on:

The SplineController keeps a TF "pointer" internally. By adding/removing CPs the same TF would result in a different position and this causes the jumps you're noticing.

Note that even after 2.0.5 AdaptOnChange can't handle multiple actions in a single frame, so the easiest way is to handle it by yourself, because you know where you delete/add what. Two ways to handle this:

1.) Use SplineController.Spline.TFToSegment(SplineController.RelativePosition) to get the current segment and local position within. Then add/remove CP's at will (not the one you're over, but anything else is fine), then set the controller to the new TF (shortened): RelativePosition=seg.LocalFToTF(localF)
2.) Store the distance from start (SplineController.AbsolutePosition). Adding CP's in front of the current position is fine, if you remove CP's behind it, subtract the length of the deleted segment from the stored distance. After done, set SplineController.AbsoluteDistance to your stored value.

I'd prefer the former solution because of better accuracy.
Reply


Messages In This Thread
RE: SplineController skips on CurvySpline.ControlPoints[0].Delete() - by Jake - 02-02-2016, 10:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Play() does not cause SplineController to produce expected behaviour ConCat 8 2,025 02-08-2026, 11:54 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,894 07-29-2025, 09:15 PM
Last Post: _Aka_
  Destroying curvyspline instances jmh1804 5 3,361 09-18-2024, 07:52 AM
Last Post: _Aka_
  CurvySpline Optimize Candy 1 1,636 08-02-2024, 08:35 AM
Last Post: _Aka_

Forum Jump: