Hi,
- Here is an example of code, as seen in the example scene 05_NearestPoint, to get the nearest point on a spline:
float nearestTF = Spline.GetNearestPointTF(Lookup.position, Space.World);
transform.position = Spline.Interpolate(nearestTF, Space.World);
If you want the position of a sample point, in opposition of an exacte position on the spline, use InterpolateFast instead of Interpolate.
- You can use the HandleOutPosition and HandleInPosition to set the handles in world coordinates.
- I have a GetNearestPointTF that works for rays, but it is not optimized nor properly tested. I attached the needed files to this post. Might nor compile with the latest version of Curvy. If so, fixing the compiler errors should not be difficult.
- Not sure about what you mean in your point 4. By creating a spline Curvy aytomatically generates tangents, so you don't have to do it yourself.
- If you use SplineController, then you can use the SwitchTo method, or get inspiration from its implementation, to switch between two splines.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.