voxel-traversal

Crates.iovoxel-traversal
lib.rsvoxel-traversal
version0.2.1
sourcesrc
created_at2024-06-22 20:22:29.750203
updated_at2024-08-26 21:27:45.111449
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,559
Chrisitian Steenkamp (ChrisTechs)

documentation

README

Voxel Traversal Algorithm

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

Example

This crate uses glam for linear algebra.


// f32

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

// there is also a DVec3 implementation called voxel_traversal_f64

License

Licensed under MIT LICENSE

Commit count: 7

cargo fmt