rayAABB()
Ray vs axis-aligned box; returns entry distance along d (or null on miss).
function rayAABB(
o: Vec3,
d: Vec3,
min: Vec3,
max: Vec3
): number | null;Defined in: ray.ts:15
Parameters
Returns
number | null
makeRay()
Reconstruct the world-space ray through a client (pixel) coordinate, matching the shader's per-pixel ray basis. Returns the camera origin + a (non-unit) dir. clientX/clientY are pointer-event coordinates; the canvas's CSS box and backing-store aspect are read, so this needs a browser.
voxelRaycast()
CPU voxel raycast (Amanatides-Woo DDA), the same walk shaders/trace.wesl does on the GPU minus the coarse skip. dir need not be normalised; t is in units of dir (so origin + dir t is the hit point). Cells count as solid when data[i] !== 0 unless a solid predicate is given. Returns null when...