Skip to content

Commit

Permalink
Triangle: Return null in getInterpolation() if triangle is degenerate. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Dec 15, 2023
1 parent 096fb16 commit 6dce5c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions types/three/src/math/Triangle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export class Triangle {
getMidpoint(target: Vector3): Vector3;
getNormal(target: Vector3): Vector3;
getPlane(target: Plane): Plane;
getBarycoord(point: Vector3, target: Vector3): Vector3;
getBarycoord(point: Vector3, target: Vector3): Vector3 | null;
/**
* @deprecated Triangle.getUV() has been renamed to Triangle.getInterpolation().
*/
getUV(point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2): Vector2;
getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2;
getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3;
getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4;
getInterpolation(point: Vector3, v1: Vector2, v2: Vector2, v3: Vector2, target: Vector2): Vector2 | null;
getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null;
getInterpolation(point: Vector3, v1: Vector4, v2: Vector4, v3: Vector4, target: Vector4): Vector4 | null;
containsPoint(point: Vector3): boolean;
intersectsBox(box: Box3): boolean;
isFrontFacing(direction: Vector3): boolean;
Expand Down Expand Up @@ -78,7 +78,7 @@ export class Triangle {
v2: Vector2,
v3: Vector2,
target: Vector2,
): Vector2;
): Vector2 | null;
static getInterpolation(
point: Vector3,
p1: Vector3,
Expand All @@ -88,7 +88,7 @@ export class Triangle {
v2: Vector3,
v3: Vector3,
target: Vector3,
): Vector3;
): Vector3 | null;
static getInterpolation(
point: Vector3,
p1: Vector3,
Expand All @@ -98,6 +98,6 @@ export class Triangle {
v2: Vector4,
v3: Vector4,
target: Vector4,
): Vector4;
): Vector4 | null;
static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean;
}

0 comments on commit 6dce5c5

Please sign in to comment.