Ray.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { Vector3 } from './Vector3';
  2. import { Sphere } from './Sphere';
  3. import { Plane } from './Plane';
  4. import { Box3 } from './Box3';
  5. import { Matrix4 } from './Matrix4';
  6. export class Ray {
  7. constructor( origin?: Vector3, direction?: Vector3 );
  8. /**
  9. * @default new THREE.Vector3()
  10. */
  11. origin: Vector3;
  12. /**
  13. * @default new THREE.Vector3( 0, 0, - 1 )
  14. */
  15. direction: Vector3;
  16. set( origin: Vector3, direction: Vector3 ): Ray;
  17. clone(): Ray;
  18. copy( ray: Ray ): this;
  19. at( t: number, target: Vector3 ): Vector3;
  20. lookAt( v: Vector3 ): Ray;
  21. recast( t: number ): Ray;
  22. closestPointToPoint( point: Vector3, target: Vector3 ): Vector3;
  23. distanceToPoint( point: Vector3 ): number;
  24. distanceSqToPoint( point: Vector3 ): number;
  25. distanceSqToSegment(
  26. v0: Vector3,
  27. v1: Vector3,
  28. optionalPointOnRay?: Vector3,
  29. optionalPointOnSegment?: Vector3
  30. ): number;
  31. intersectSphere( sphere: Sphere, target: Vector3 ): Vector3 | null;
  32. intersectsSphere( sphere: Sphere ): boolean;
  33. distanceToPlane( plane: Plane ): number;
  34. intersectPlane( plane: Plane, target: Vector3 ): Vector3 | null;
  35. intersectsPlane( plane: Plane ): boolean;
  36. intersectBox( box: Box3, target: Vector3 ): Vector3 | null;
  37. intersectsBox( box: Box3 ): boolean;
  38. intersectTriangle(
  39. a: Vector3,
  40. b: Vector3,
  41. c: Vector3,
  42. backfaceCulling: boolean,
  43. target: Vector3
  44. ): Vector3 | null;
  45. applyMatrix4( matrix4: Matrix4 ): Ray;
  46. equals( ray: Ray ): boolean;
  47. /**
  48. * @deprecated Use {@link Ray#intersectsBox .intersectsBox()} instead.
  49. */
  50. isIntersectionBox( b: any ): any;
  51. /**
  52. * @deprecated Use {@link Ray#intersectsPlane .intersectsPlane()} instead.
  53. */
  54. isIntersectionPlane( p: any ): any;
  55. /**
  56. * @deprecated Use {@link Ray#intersectsSphere .intersectsSphere()} instead.
  57. */
  58. isIntersectionSphere( s: any ): any;
  59. }
粤ICP备19079148号