File size: 1,165 Bytes
6cd9596
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { Vector3 } from './Vector3';
import { Plane } from './Plane';

export interface SplineControlPoint {
  x: number;
  y: number;
  z: number;
}

export class Triangle {
  constructor(a?: Vector3, b?: Vector3, c?: Vector3);

  a: Vector3;
  b: Vector3;
  c: Vector3;

  set(a: Vector3, b: Vector3, c: Vector3): Triangle;
  setFromPointsAndIndices(
    points: Vector3[],
    i0: number,
    i1: number,
    i2: number
  ): Triangle;
  clone(): this;
  copy(triangle: Triangle): this;
  getArea(): number;
  getMidpoint(target: Vector3): Vector3;
  getNormal(target: Vector3): Vector3;
  getPlane(target: Vector3): Plane;
  getBarycoord(point: Vector3, target: Vector3): Vector3;
  containsPoint(point: Vector3): boolean;
  closestPointToPoint(point: Vector3, target: Vector3): Vector3;
  equals(triangle: Triangle): boolean;

  static getNormal(
    a: Vector3,
    b: Vector3,
    c: Vector3,
    target: Vector3
  ): Vector3;
  static getBarycoord(
    point: Vector3,
    a: Vector3,
    b: Vector3,
    c: Vector3,
    target: Vector3
  ): Vector3;
  static containsPoint(
    point: Vector3,
    a: Vector3,
    b: Vector3,
    c: Vector3
  ): boolean;
}