Determines if camera's frustum intersects with aabb box and sphere
npm install frustum-intersectsshell
npm i frustum-intersects --save
`
`js
import { intersectsBox, intersectsSphere } from 'frustum-intersects';
const ret = intersectsBox([
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1],
[[-1,-1,-1], [1,1,1]]);
const ret2 = intersectsSphere([
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1],
[[0, 0, 0], 1]);
`
$3
`html
`
API
$3
* matrix camera's 4x4 projection view matrix array, compatible with gl-matrix
* box the aabb box, [[minx, miny, minz], [maxx, maxy, maxz]]
* mask A 6 chars string mask (e.g. "111111") of frustum planes, plane with mask of 0 will always return true
$3
* matrix camera's 4x4 projection view matrix array, compatible with gl-matrix
* sphere sphere, [[centerx, centery, centerz], radius]
* mask A 6 chars string mask (e.g. "111111") of frustum planes, plane with mask of 0 will always return true
>> the planes' order of mask is {right}{left}{bottom}{top}{z-far}{z-near}`,