visibility(opts)
Test whether a point, a sphere or an axis-aligned box is inside, crossing or
outside the current camera's view frustum, returning VISIBLE, SEMIVISIBLE or
INVISIBLE (see the sphere example). Give a point as center, a sphere as
center plus radius, and a box as its two corners; mat4Model places
local-space bounds in the world (see the AABB example), and bounds tests
against another camera's planes from bounds(). Needs a WEBGL canvas.
| Parameter | Type | Default | Description |
|---|---|---|---|
opts |
{
corner1?: Float32Array | ArrayLike | p5.Vector,
corner2?: Float32Array | ArrayLike | p5.Vector,
center?: Float32Array | ArrayLike | p5.Vector,
radius?: number,
bounds?: object,
mat4Model?: Float32Array | ArrayLike | p5.Matrix,
} |
Returns number p5.Tree.VISIBLE | SEMIVISIBLE | INVISIBLE