Provide bounded 3D grid-ray traversal with specified boundary and corner behavior #12

Closed
opened 2026-12-02 19:31:17 +00:00 by faumaray · 1 comment
Owner

An editor needs to visit integer cells in order along a ray and identify the first occupied cell and entry face. Our consumer uses a signed, z-up voxel region and a renderer with a custom isometric camera. Occupancy, materials and camera projection stay with the caller. Picking contract

At 7b0fea6095f603f9e1904f66dfdc7752f4be4792, the library supplies vector operations and checked numeric conversions. We could not find a public grid-ray traversal with bounded work and a defined choice at a face, edge or corner. Vector arithmetic · Numeric conversions

Would a bounded traversal accepting an occupancy callback, or yielding visited cells and entry faces, fit the Math/Algorithms API? Document the policy for a start exactly on a boundary, a start inside an occupied cell, simultaneous axis crossings, zero components, nonfinite input and step/distance exhaustion.

Replacement tests would trace from (31.5,31.5,31.5) in direction (1,1,1) through (32,32,32), reverse the ray, repeat on the negative side of the origin, and permute the order in which chunks were loaded. The selected cell/face should agree with the documented tie policy in each case. Include an axis-parallel ray and one ending exactly on the grid boundary, and run the same vectors on Windows x64.

An editor needs to visit integer cells in order along a ray and identify the first occupied cell and entry face. Our consumer uses a signed, z-up voxel region and a renderer with a custom isometric camera. Occupancy, materials and camera projection stay with the caller. [Picking contract](https://git.faumaray.com/Lagg1ng/stoneheart_at_home/src/commit/2a5df1a18b055adc71bd9d3defe2bec40c4496e7/docs/plan/systems/S17.md) At `7b0fea6095f603f9e1904f66dfdc7752f4be4792`, the library supplies vector operations and checked numeric conversions. We could not find a public grid-ray traversal with bounded work and a defined choice at a face, edge or corner. [Vector arithmetic](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/include/Void/Math/Vec.hpp) · [Numeric conversions](https://git.faumaray.com/Void/Library/src/commit/7b0fea6095f603f9e1904f66dfdc7752f4be4792/include/Void/Math/Numeric.hpp) Would a bounded traversal accepting an occupancy callback, or yielding visited cells and entry faces, fit the Math/Algorithms API? Document the policy for a start exactly on a boundary, a start inside an occupied cell, simultaneous axis crossings, zero components, nonfinite input and step/distance exhaustion. Replacement tests would trace from (31.5,31.5,31.5) in direction (1,1,1) through (32,32,32), reverse the ray, repeat on the negative side of the origin, and permute the order in which chunks were loaded. The selected cell/face should agree with the documented tie policy in each case. Include an axis-parallel ray and one ending exactly on the grid boundary, and run the same vectors on Windows x64.
Author
Owner

Implemented on branch issue/12-grid-ray (local commit 0be2526).

Void::Algorithms::GridRayIterator/raycast_grid added: bounded 3D DDA with a documented boundary/corner tie policy, entry faces and explicit exhaustion/nonfinite handling.

Merge request: #28

Implemented on branch `issue/12-grid-ray` (local commit `0be2526`). `Void::Algorithms::GridRayIterator`/`raycast_grid` added: bounded 3D DDA with a documented boundary/corner tie policy, entry faces and explicit exhaustion/nonfinite handling. Merge request: https://git.faumaray.com/Void/Library/pulls/28
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#12