10-01-2022, 11:50 AM
Hi
Here is the code applying the offset:
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
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
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Please consider leaving a review for Curvy, this helps immensely. Thank you.

