Triangle.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import { Vector2 } from './Vector2';
  2. import { Vector3 } from './Vector3';
  3. import { Plane } from './Plane';
  4. import { Box3 } from './Box3';
  5. export interface SplineControlPoint {
  6. x: number;
  7. y: number;
  8. z: number;
  9. }
  10. export class Triangle {
  11. constructor( a?: Vector3, b?: Vector3, c?: Vector3 );
  12. a: Vector3;
  13. b: Vector3;
  14. c: Vector3;
  15. set( a: Vector3, b: Vector3, c: Vector3 ): Triangle;
  16. setFromPointsAndIndices(
  17. points: Vector3[],
  18. i0: number,
  19. i1: number,
  20. i2: number
  21. ): Triangle;
  22. clone(): this;
  23. copy( triangle: Triangle ): this;
  24. getArea(): number;
  25. getMidpoint( target: Vector3 ): Vector3;
  26. getNormal( target: Vector3 ): Vector3;
  27. getPlane( target: Plane ): Plane;
  28. getBarycoord( point: Vector3, target: Vector3 ): Vector3;
  29. getUV( point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2 ): Vector2;
  30. containsPoint( point: Vector3 ): boolean;
  31. intersectsBox( box: Box3 ): boolean;
  32. isFrontFacing( direction: Vector3 ): boolean;
  33. closestPointToPoint( point: Vector3, target: Vector3 ): Vector3;
  34. equals( triangle: Triangle ): boolean;
  35. static getNormal(
  36. a: Vector3,
  37. b: Vector3,
  38. c: Vector3,
  39. target: Vector3
  40. ): Vector3;
  41. static getBarycoord(
  42. point: Vector3,
  43. a: Vector3,
  44. b: Vector3,
  45. c: Vector3,
  46. target: Vector3
  47. ): Vector3;
  48. static containsPoint(
  49. point: Vector3,
  50. a: Vector3,
  51. b: Vector3,
  52. c: Vector3
  53. ): boolean;
  54. static getUV(
  55. point: Vector3,
  56. p1: Vector3,
  57. p2: Vector3,
  58. p3: Vector3,
  59. uv1: Vector2,
  60. uv2: Vector2,
  61. uv3: Vector2,
  62. target: Vector2
  63. ): Vector2;
  64. static isFrontFacing(
  65. a: Vector3,
  66. b: Vector3,
  67. c: Vector3,
  68. direction: Vector3
  69. ): boolean;
  70. }