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

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: 
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?
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 will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 9 27 05-17-2024, 09:35 AM
Last Post: _Aka_
  Twisting Splines ZiggZagg 6 11 05-14-2024, 04:48 PM
Last Post: _Aka_
  Help with procedural roads and splines ramiroflores 1 6 05-07-2024, 08:57 AM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_

Forum Jump: