@turbox3d/math
Version:
Large-scale graphics application math library
36 lines (35 loc) • 1.32 kB
TypeScript
import { Matrix4 } from './Matrix4';
import { Vector3 } from './Vector3';
declare class Box3 {
min: Vector3;
max: Vector3;
readonly isBox3: boolean;
constructor(min?: Vector3, max?: Vector3);
set(min: Vector3, max: Vector3): this;
setFromArray(array: ArrayLike<number>): this;
setFromPoints(points: Vector3[]): this;
setFromCenterAndSize(center: Vector3, size: Vector3): this;
clone(): Box3;
copy(box: Box3): this;
makeEmpty(): this;
isEmpty(): boolean;
getCenter(target: Vector3): Vector3;
getSize(target: Vector3): Vector3;
expandByPoint(point: Vector3): this;
expandByVector(vector: Vector3): this;
expandByScalar(scalar: number): this;
containsPoint(point: Vector3, distTol?: number): boolean;
containsBox(box: Box3, distTol?: number): boolean;
isOverlapping(box: Box3, distTol?: number): boolean;
getParameter(point: Vector3, target: Vector3): Vector3;
intersectsBox(box: Box3): boolean;
clampPoint(point: Vector3, target: Vector3): Vector3;
distanceToPoint(point: Vector3): number;
intersect(box: Box3): this;
union(box: Box3): this;
applyMatrix4(matrix: Matrix4): this;
translate(offset: Vector3): this;
equals(box: Box3, distTol?: number): boolean;
isValid(): boolean;
}
export { Box3 };