Skip to content

xenon615/bevy_random_loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate Random Loop

Let's say we need a race track, and we need to get a random set of points that describe it.

Usage

Please refer to /examples/basic.rs

Lets create convex hull around random points

    let mut rpath = RandomLoop::generate(12, vec3(100., 0., 100.));

image1 Add extra points

    RandomLoop::vary(&mut rpath, 50.);

image2

Smooth it

    RandomLoop::smooth_out(&mut rpath, 120f32.to_radians(), 20.);

image3

        let cr = CubicBSpline::new(rpath).to_curve_cyclic().unwrap();
        let spline = cr.iter_positions(120).collect::<Vec<_>>();

image4

Version Compatibility

bevy bevy_random_loop
0.18 0.1
0.19 0.2, master

About

Generating closed loop points that can be used to create race tracks or anything else

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-Apache
MIT
LICENSE-MIT

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages