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
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_

Forum Jump: