Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AutoHandle slope
#1
I control the smoothing of all curves by setting the values of the CP handles (hidden from the user). I had been using AutoHandles when there are curved segments on both sides of a CP (as opposed to explicit straight segments).

I now need to control the curve of the X-Z plane separately from the Y dimension. AutoHandles don't know how to do this of course.
I could turn on AutoHandles, let Curvy position the handles, then turn it off and set the Y value myself. But this is a kludge and not very performant.

I've tried to infer what the formula is for the direction of the linear HandelIn to HandleOut vector when AutoHandle is turned on. But I don't have the chops to figure it out.

Given the position of three CPs (CP-1, CP, CP+1) how is he tangent of the AutoHandle for CP calculated? I only need this in the X-Z plane.

You assistance would be appreciated.
Reply
#2
Hi
The Auto handles are calculated inside this method of the CurvySplineSegment class:
public void SetBezierHandles(float distanceFrag, Vector3 p, Vector3 n, bool setIn = true, bool setOut = true, bool noDirtying = false)
This methods is called with the following value:
distanceFrag = the value of the AutoHandleDistance property, displayed as "Distance %" in the segment's inspector. Default value is 0.39f
p: vector to the previous CP's position
n: vector to the next CP's posotion
Did this answer your question?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Works great. I was looking for routines with references to AutoHandle or m_autohandle.
Reply
#4
Great. Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Forum Jump: