#traversal #voxel #3d #position #space #end #start

voxel-traversal

Traverse through all voxels in a 3d space from a start position to an end position

4 releases (2 breaking)

0.3.0 Dec 17, 2024
0.2.1 Aug 26, 2024
0.2.0 Jun 23, 2024
0.1.0 Jun 22, 2024

#5 in #end

Download history 20/week @ 2024-09-14 19/week @ 2024-09-21 23/week @ 2024-09-28 2/week @ 2024-10-05 2/week @ 2024-12-07 126/week @ 2024-12-14 9/week @ 2024-12-21

137 downloads per month

MIT license

10KB
182 lines

Voxel Traversal Algorithm

This is a rust port of https://github.com/francisengelmann/fast_voxel_traversal.

Example


// f32

voxel_traversal::voxel_traversal(
    start, // (f32,f32,f32)
    end, // (f32,f32,f32)
    |pos, normal| { // (i32,i32,i32), (i32,i32,i32)
    // return true to exit
    if (pos.0 == 0) {
        return true;
    } else {
        // return false to continue traversing
        return false
    }
    }
);

// there is also a f64 implementation called voxel_traversal_f64

License

Licensed under MIT LICENSE

No runtime deps