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


Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 5 18 04-25-2024, 11:11 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_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  Using Unity's SplineContainer in Curvy Splines dlees9191 3 15 02-26-2024, 09:49 AM
Last Post: _Aka_

Forum Jump: