UNPKG

2.32 kBTypeScriptView Raw
1import { BufferAttribute } from "../core/BufferAttribute.js";
2import { Object3D } from "../core/Object3D.js";
3import { Matrix4 } from "./Matrix4.js";
4import { Plane } from "./Plane.js";
5import { Sphere } from "./Sphere.js";
6import { Triangle } from "./Triangle.js";
7import { Vector3 } from "./Vector3.js";
8
9export class Box3 {
10 constructor(min?: Vector3, max?: Vector3);
11
12 /**
13 * @default new THREE.Vector3( + Infinity, + Infinity, + Infinity )
14 */
15 min: Vector3;
16
17 /**
18 * @default new THREE.Vector3( - Infinity, - Infinity, - Infinity )
19 */
20 max: Vector3;
21 readonly isBox3: true;
22
23 set(min: Vector3, max: Vector3): this;
24 setFromArray(array: ArrayLike<number>): this;
25 setFromBufferAttribute(bufferAttribute: BufferAttribute): this;
26 setFromPoints(points: Vector3[]): this;
27 setFromCenterAndSize(center: Vector3, size: Vector3): this;
28 setFromObject(object: Object3D, precise?: boolean): this;
29 clone(): this;
30 copy(box: Box3): this;
31 makeEmpty(): this;
32 isEmpty(): boolean;
33 getCenter(target: Vector3): Vector3;
34 getSize(target: Vector3): Vector3;
35 expandByPoint(point: Vector3): this;
36 expandByVector(vector: Vector3): this;
37 expandByScalar(scalar: number): this;
38 expandByObject(object: Object3D, precise?: boolean): this;
39 containsPoint(point: Vector3): boolean;
40 containsBox(box: Box3): boolean;
41 getParameter(point: Vector3, target: Vector3): Vector3;
42 intersectsBox(box: Box3): boolean;
43 intersectsSphere(sphere: Sphere): boolean;
44 intersectsPlane(plane: Plane): boolean;
45 intersectsTriangle(triangle: Triangle): boolean;
46 clampPoint(point: Vector3, target: Vector3): Vector3;
47 distanceToPoint(point: Vector3): number;
48 getBoundingSphere(target: Sphere): Sphere;
49 intersect(box: Box3): this;
50 union(box: Box3): this;
51 applyMatrix4(matrix: Matrix4): this;
52 translate(offset: Vector3): this;
53 equals(box: Box3): boolean;
54 /**
55 * @deprecated Use {@link Box3#isEmpty .isEmpty()} instead.
56 */
57 empty(): any;
58 /**
59 * @deprecated Use {@link Box3#intersectsBox .intersectsBox()} instead.
60 */
61 isIntersectionBox(b: any): any;
62 /**
63 * @deprecated Use {@link Box3#intersectsSphere .intersectsSphere()} instead.
64 */
65 isIntersectionSphere(s: any): any;
66}