voxel-traversal

Crates.iovoxel-traversal
lib.rsvoxel-traversal
version0.3.0
created_at2024-06-22 20:22:29.750203+00
updated_at2024-12-17 20:46:21.501709+00
descriptionTraverse through all voxels in a 3d space from a start position to an end position.
homepage
repositoryhttps://github.com/ChrisTechs/voxel-traversal
max_upload_size
id1280672
size10,518
Chrisitian Steenkamp (ChrisTechs)

documentation

README

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

Commit count: 10

cargo fmt