Box3.d.ts 2.1 KB

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