aabb3_raycast
aabb3_raycast(result, result_offset, x0, y0, z0, x1, y1, z1, origin_x, origin_y, origin_z, direction_x, direction_y, direction_z) ⇒ boolean
Kind: global function
Returns: boolean
- true if ray hit the box, false otherwise
See
- https://tavianator.com/fast-branchless-raybounding-box-intersections-part-2-nans/
- https://gdbooks.gitbooks.io/3dcollisions/content/Chapter3/raycast_aabb.html
- https://blog.johnnovak.net/2016/10/22/the-nim-ray-tracer-project-part-4-calculating-box-normals/
Param | Type | Description |
---|---|---|
result | Array.<number> | ArrayLike.<number> | Float32Array | hit 6-tuple is written here as follows: [hit_position_x, hit_position_y, hit_position_z, hit_normal_x, hit_normal_y, hit_normal_z] |
result_offset | number | offset into result array where to write the hit data |
x0 | number | |
y0 | number | |
z0 | number | |
x1 | number | |
y1 | number | |
z1 | number | |
origin_x | number | ray origin |
origin_y | number | ray origin |
origin_z | number | ray origin |
direction_x | number | ray direction |
direction_y | number | ray direction |
direction_z | number | ray direction |