Skip to content

Function: raycastSlab() ​

ts
function raycastSlab(g, z0, z1, o, d, clip): ExtrusionHit | undefined;

Experimental

Where a ray (in the slab's own world frame) first meets the slab from z0 to z1: its front face (or its plane within NEAR px of it, where the lines along the edge are drawn) or a wall facing the ray, inside the world box clip (x0, y0, x1, y1). The hit point on a wall is moved a hair inside the fill.

Parameters ​

ParameterType
gSlabGeometry
z0number
z1number
o{ x: number; y: number; z: number; }
o.xnumber
o.ynumber
o.znumber
d{ x: number; y: number; z: number; }
d.xnumber
d.ynumber
d.znumber
clipreadonly [number, number, number, number]

Returns ​

ExtrusionHit | undefined

Released under the MIT License.