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
Thumbs Up Can't delete connection lacota 3 6 03-16-2024, 11:34 AM
Last Post: _Aka_
  I have a question about curvySpline haifeng.huang 12 32 07-14-2023, 09:34 AM
Last Post: _Aka_
Thumbs Up Assembly Definitions (Solved) lacota 3 6 06-01-2023, 11:04 AM
Last Post: _Aka_
  "Deadloop in CurvySPline.Refresh" spam Valkymaera 3 11 05-30-2023, 10:56 AM
Last Post: _Aka_

Forum Jump: