Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Splines and Generators Performantly for Road System
#1
Hello!

My use case is roads and multiple style of roads, this is procedural generation system

Right now I have a generator and am referencing the InputSplinePath and setting the spline in code at runtime: 
Code:
public InputSplinePath inputSplinePath;
    void Start(){
        var spline = CurvySpline.Create();
        spline.Add(.....); // Vector3 Positions to add roads
        inputSplinePath.Spline = spline;
    }

Now I want to generate breaks / no roads regions. Is there an optimal / performant way to do this?

If I want the road to be between say the origin and point (100,0,100).
With a empty spot at specific points. How do I generate these breaks. (no road will be generated).
For example I want a break / no road between (40,0,40) and (60,0,60). 
Do I need to generate a multiple splines & generators?
How do I do this dynamically in code? (the break will not always be at the same spot)

Another question mentioned generating the spline path with code and calling the input Spline Path
Is this the most performant way to do this?
Is there a way for a generator to support a list of InputSplinePaths?
Reply
#2
Hi
You will have to use the Range parameters of your Shape Extrusion and/or Rasterize Path module.
To modify it at runtime, use the From and To settings of the module. Check Curvy's API reference for more details about how to use them.
The value of these parameters should be equal to: Distance_Of_Your_Point / Path_Length

A generator can contain as many InputSplinePaths as you want. Shape Extrusion and Rasterize Path accept only one path as an input. No support for a list of paths as input for now.

Did this message help?
Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Dreamteck Splines _Aka_ 0 0 07-19-2024, 08:27 PM
Last Post: _Aka_
Information New free asset: Converter For Unity Splines _Aka_ 20 61 07-19-2024, 05:15 PM
Last Post: _Aka_
  Invisible Gizmos In Latest Curvy Splines orrenravid1 1 5 06-11-2024, 07:36 AM
Last Post: _Aka_
  Twisting Splines ZiggZagg 6 15 05-14-2024, 04:48 PM
Last Post: _Aka_

Forum Jump: