05-02-2019, 10:55 AM
Hi,
1) To get the TF: SplineController.RelativePosition
To get the normalized distance: SplineController.AbsolutePosition / SplineController.Spline.Length
The difference between TF and Distance is explained here: https://curvyeditor.com/documentation/splines/start#units
2) Both are done by a single method: CurvySpline.GetNearestPointTF(Vector3 localPosition, out Vector3 nearestPoint)
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a826c07a945b2ddc06e627369c49bc5a6
3) It is the case
4) Via the API: CurvySpline.MakePlanar methods
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a19213a21e3ae976cdb8715e34236174b
This method is accessible in the inspector via the Restrict to 2D option
https://curvyeditor.com/documentation/splines/curvyspline#restrict_to_2d
Note that Restrict to 2D make the spline planar on the X/Y plane. Right now, there is no plane selector in the inspector. Your message made me notice this lack. I will add a selector in a future version. But until then, I can send you a modified version of Curvy's code that will add said selector in the inspector.
Also, there is a functionality to project a spline on any collider, including planes:
https://curvyeditor.com/documentation/toolbar?s[]=project&s[]=camera#camera_project
All of the above is doable both in edit mode and play mode
If you have any other question please let me know.
Have a nice day
1) To get the TF: SplineController.RelativePosition
To get the normalized distance: SplineController.AbsolutePosition / SplineController.Spline.Length
The difference between TF and Distance is explained here: https://curvyeditor.com/documentation/splines/start#units
2) Both are done by a single method: CurvySpline.GetNearestPointTF(Vector3 localPosition, out Vector3 nearestPoint)
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a826c07a945b2ddc06e627369c49bc5a6
3) It is the case
4) Via the API: CurvySpline.MakePlanar methods
https://api.curvyeditor.com/520/class_fluffy_underware_1_1_curvy_1_1_curvy_spline.html#a19213a21e3ae976cdb8715e34236174b
This method is accessible in the inspector via the Restrict to 2D option
https://curvyeditor.com/documentation/splines/curvyspline#restrict_to_2d
Note that Restrict to 2D make the spline planar on the X/Y plane. Right now, there is no plane selector in the inspector. Your message made me notice this lack. I will add a selector in a future version. But until then, I can send you a modified version of Curvy's code that will add said selector in the inspector.
Also, there is a functionality to project a spline on any collider, including planes:
https://curvyeditor.com/documentation/toolbar?s[]=project&s[]=camera#camera_project
All of the above is doable both in edit mode and play mode
If you have any other question please let me know.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.