08-17-2020, 01:47 PM
The way I would have done it (warning, pseudo code, might not compile due to minor mistakes):
Vector3 closestPointSecondSpline;
secondSpline.GetNearestPointTF(firstSpline.Interpolate (1f, Space.Word), out closestPointSecondSpline), Space.Local);
float closestPointOnSecondSplineTF = secondSpline.GetNearestPointTF(closestPointSecondSpline, Space.Local);
Vector3 tangentOne = firstSpline.GetTangent(1f, Space.World);
Vector3 tangentTwo = secondSpline.GetTangent(closestPointOnSecondSplineTF, Space.World);
Now you have tangents of both closest point on the splines. Compare their direction by using a Dot Product, and that's it.
Vector3 closestPointSecondSpline;
secondSpline.GetNearestPointTF(firstSpline.Interpolate (1f, Space.Word), out closestPointSecondSpline), Space.Local);
float closestPointOnSecondSplineTF = secondSpline.GetNearestPointTF(closestPointSecondSpline, Space.Local);
Vector3 tangentOne = firstSpline.GetTangent(1f, Space.World);
Vector3 tangentTwo = secondSpline.GetTangent(closestPointOnSecondSplineTF, Space.World);
Now you have tangents of both closest point on the splines. Compare their direction by using a Dot Product, and that's it.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.