Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I find the point on the spline after applying with offset angle+radius?
#2
Hi
Here is the code applying the offset:

Code:
        /// <summary>         /// Returns the position of the controller after applying an offset         /// </summary>         /// <param name="position">The controller's position</param>         /// <param name="tangent">The tangent at the controller's position</param>         /// <param name="up">The Up direction at the controller's position</param>         /// <param name="offsetAngle"><see cref="OffsetAngle"/></param>         /// <param name="offsetRadius"><see cref="OffsetRadius"/></param>         protected static Vector3 ApplyOffset(Vector3 position, Vector3 tangent, Vector3 up, float offsetAngle, float offsetRadius)         {             Quaternion offsetRotation = Quaternion.AngleAxis(offsetAngle, tangent);             return position.Addition((offsetRotation * up).Multiply(offsetRadius));         }

As you can see, the point is at a radius of offsetRadius from the point on the spline, and has an angle of offsetAngle with the spline's up vector (also called orientation) at said point.
I hope this helped
Have a nice day
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
RE: How can I find the point on the spline after applying with offset angle+radius? - by _Aka_ - 10-01-2022, 11:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Generator gameobjects missing offset and rotated beewhale 5 839 08-30-2026, 07:51 PM
Last Post: beewhale
  Spline Issue Leading to Unity Freeze Pankaj09 1 425 08-24-2026, 11:28 PM
Last Post: _Aka_
  Connecting Multiple Spline Nodes Issue Ritesh Kadam 1 368 08-22-2026, 11:24 PM
Last Post: _Aka_
  Spline Spots from 2 samples. BitBlit 8 1,523 06-30-2026, 11:49 AM
Last Post: _Aka_

Forum Jump: