UNPKG

1.48 kBTypeScriptView Raw
1import { Vector2 } from "./Vector2.js";
2
3// Math //////////////////////////////////////////////////////////////////////////////////
4
5export class Box2 {
6 constructor(min?: Vector2, max?: Vector2);
7
8 /**
9 * @default new THREE.Vector2( + Infinity, + Infinity )
10 */
11 min: Vector2;
12
13 /**
14 * @default new THREE.Vector2( - Infinity, - Infinity )
15 */
16 max: Vector2;
17
18 set(min: Vector2, max: Vector2): Box2;
19 setFromPoints(points: Vector2[]): Box2;
20 setFromCenterAndSize(center: Vector2, size: Vector2): Box2;
21 clone(): this;
22 copy(box: Box2): this;
23 makeEmpty(): Box2;
24 isEmpty(): boolean;
25 getCenter(target: Vector2): Vector2;
26 getSize(target: Vector2): Vector2;
27 expandByPoint(point: Vector2): Box2;
28 expandByVector(vector: Vector2): Box2;
29 expandByScalar(scalar: number): Box2;
30 containsPoint(point: Vector2): boolean;
31 containsBox(box: Box2): boolean;
32 getParameter(point: Vector2, target: Vector2): Vector2;
33 intersectsBox(box: Box2): boolean;
34 clampPoint(point: Vector2, target: Vector2): Vector2;
35 distanceToPoint(point: Vector2): number;
36 intersect(box: Box2): Box2;
37 union(box: Box2): Box2;
38 translate(offset: Vector2): Box2;
39 equals(box: Box2): boolean;
40 /**
41 * @deprecated Use {@link Box2#isEmpty .isEmpty()} instead.
42 */
43 empty(): any;
44 /**
45 * @deprecated Use {@link Box2#intersectsBox .intersectsBox()} instead.
46 */
47 isIntersectionBox(b: any): any;
48}