Crates.io | voxel-traversal |
lib.rs | voxel-traversal |
version | 0.2.1 |
source | src |
created_at | 2024-06-22 20:22:29.750203 |
updated_at | 2024-08-26 21:27:45.111449 |
description | Traverse through all voxels in a 3d space from a start position to an end position. |
homepage | |
repository | https://github.com/ChrisTechs/voxel-traversal |
max_upload_size | |
id | 1280672 |
size | 10,559 |
This is a rust port of https://github.com/francisengelmann/fast_voxel_traversal.
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
Licensed under MIT LICENSE