Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurvySpline.GetExtrusionPoint() does not account for orientation
#1
So in my testing, CurvySpline.GetExtrusionPoint() does not appear to account for orientation. Which means I need to calculate a rotation anyway which makes the method basically pointless as I can just use my rotation to extrude a point directly myself anyway.

I couldn't find any actual uses of GetExtrusionPoint in the codebase, is this the intended functionality of this method?
Reply
#2
(09-14-2013, 12:03 PM)chris Wrote: So in my testing, CurvySpline.GetExtrusionPoint() does not appear to account for orientation. Which means I need to calculate a rotation anyway which makes the method basically pointless as I can just use my rotation to extrude a point directly myself anyway.
Hi Chris,

right, you'll need to feed in orientation by yourself, but you don't need to calculate it:
Code:
Vector3 pos=Spline.Interpolate(0.5f);
Vector3 tangent=Spline.GetTangent(0.5f);
Vector3 up=Spline.GetOrientationUpFast(0.5f);
Vector3 targetPoint=GetExtrusionPoint(pos,tangent,up,4f,180f); // gives a point on the opposite of the splines Up-Vector (180°) at 4 units distance

In fact GetExtrusionPoint is just a shortcut for a few calculations, useful for those who don't know how to calculate it. I could have reduced it to just radius and angle, but than I would have to had 2 methods (+one that uses the Fast() methods). I thought that this isn't really neccessary as this isn't a widely used method.

Jake
Reply
#3
Fair enough.

I'd recommend making it a static method if it doesn't actually leverage any of the member data that it has available to it from the current spline. That would help identify it as a helper method better as well.
Reply
#4
(09-14-2013, 05:17 PM)chris Wrote: Fair enough.

I'd recommend making it a static method if it doesn't actually leverage any of the member data that it has available to it from the current spline. That would help identify it as a helper method better as well.

Good idea, I'll do that.
Reply
#5
Thanks for the new GetExtrusionPoint method btw. This one is much more convenient to work with. Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Destroying curvyspline instances jmh1804 5 10 09-18-2024, 07:52 AM
Last Post: _Aka_
  CurvySpline Optimize Candy 1 6 08-02-2024, 08:35 AM
Last Post: _Aka_
  I have a question about curvySpline haifeng.huang 12 33 07-14-2023, 09:34 AM
Last Post: _Aka_
  "Deadloop in CurvySPline.Refresh" spam Valkymaera 3 12 05-30-2023, 10:56 AM
Last Post: _Aka_

Forum Jump: