Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bugs & updates needed: Curvy Move Along Spline Distance (Playmaker) not working
#5
(01-19-2014, 08:57 PM)'FritsLyn' Wrote: I'm confused on a higher level Wink Sorry!

 
You're working with a highlevel coding language, so this is absolutely normal [img]images/smilies/biggrin.gif[/img]

Ok, let me explain:

In the CurvyMoveAlongSpline action, just enable "Move by world units" to move at constant speed. That's all you need to do! So what the heck is CurvyMoveAlongSplineDistance good for, you ask? For one simple reason: If you move an object along a spline WHILE you're changing the spline's length (e.g. by adding or removing segments dynamically). For an example, see the pmDynamicSpline example.

Why?

CurvyMoveAlongSpline keeps a TF value and alters it by the speed the user want's (calling Move() or MoveBy() internally). If you add a spline segment, the same TF would refer to a totally different position on the spline, so your object would "warp around".

To overcome this, CurvyMoveAlongSplineDistance stores a Distance. On move, the distance will be converted into a TF, moved and converted back to distance (because splines internally just don't work with distances). If you now add a segment (before the object), the object stays where it should, because the distance of the object from the spline's start did not change.

The latter method is slower (two extra conversions) and as it needs to work on a spline's length you have to refresh the spline's length if you change it (otherwise it's 0 and you get the result you mentioned). Also length calculation relies on Granularity (Spline Length=length of approximation path, the gray path you'll see in the scene view when enabling Approximation gizmo), so it needs to be somewhat high to match the curve closely. On the other side, if you have linear interpolation, you can set the Granularity to 1...

Hopefully that cured your confusion a bit...

Jake
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,361 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 658 11-13-2025, 11:32 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,462 07-29-2025, 09:15 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 7 6,222 07-13-2025, 07:11 PM
Last Post: _Aka_

Forum Jump: