Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To dynamic generate the connection between paths
#3
Hi,
  1. 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.
  2. You can use the HandleOutPosition and HandleInPosition to set the handles in world coordinates.
  3. 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.
  4. 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.
  5. If you use SplineController, then you can use the SwitchTo method, or get inspiration from its implementation, to switch between two splines.
Was everything clear?


Attached Files
.cs   CurvySplineSegment_Ray.cs (Size: 2.44 KB / Downloads: 3)
.cs   CurvySpline_Ray.cs (Size: 3.13 KB / Downloads: 2)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: To dynamic generate the connection between paths - by _Aka_ - 08-07-2020, 02:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Thumbs Up Can't delete connection lacota 3 6 03-16-2024, 11:34 AM
Last Post: _Aka_
  Cant Generate Meshes At Runtime alms94 5 22 01-26-2024, 11:27 AM
Last Post: _Aka_
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 4 13 11-27-2023, 01:04 PM
Last Post: _Aka_

Forum Jump: