Skip to content

xenon615/bevy_random_loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages