Axis는 재미와 이익을 위해 경계 상자를 정렬합니다.
var aabb = require ( 'aabb-3d' )
var bounding_box = aabb ( [ 0 , 0 , 0 ] , [ 12 , 12 , 12 ] ) // x, y, z == 0; width, height, depth == 12
, other = aabb ( [ 10 , 10 , 10 ] , [ 2 , 2 , 2 ] )
bounding_box . intersects ( other ) // true
bounding_box . translate ( [ 2 , 2 , 2 ] ) // moves the bounding box
bounding_box . expand ( other ) // returns a new aabb that surrounds both bboxes
새 AABB를 반환합니다.
보고:
x0/y1/z1---x1/y1/z1
depth-> / /|
/ / |
x0/y1/z0 -- x1/y1/z0
| | |
| | <-- height
| | /
| | /
x0/y0/z0 ----- x1/y0/z0
^
|
width
상자를 움직입니다. 스스로 반환합니다.
두 개의 경계 상자가 교차하는 경우 (또는 전혀 터치하는 경우) true를 반환합니다.
두 AABB의 공유 영역을 나타내는 새로운 aabb
반환합니다. 상자가 교차하지 않으면 null
반환합니다.
두 AABB를 둘러싼 새로운 aabb
반환합니다.
MIT