Box2.d.ts 1.2 KB

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