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)
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
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
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 6 3,399 03-25-2026, 10:10 PM
Last Post: _Aka_
  Is there a way to generate UVs along deformed and copied mesh? kubak 1 277 03-18-2026, 08:34 PM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,592 12-10-2024, 10:14 PM
Last Post: _Aka_
  Anomalous connection handling SAMYTHEBIGJUICY 1 1,334 12-04-2024, 05:08 PM
Last Post: _Aka_

Forum Jump: