فهرست منبع

Triangle: TS missing methods

Guilherme Avila 6 سال پیش
والد
کامیت
989a58264a
2فایلهای تغییر یافته به همراه17 افزوده شده و 4 حذف شده
  1. 13 0
      src/math/Triangle.d.ts
  2. 4 4
      src/math/Triangle.js

+ 13 - 0
src/math/Triangle.d.ts

@@ -1,5 +1,6 @@
 import { Vector3 } from './Vector3';
 import { Plane } from './Plane';
+import { Box3 } from './Box3';
 
 export interface SplineControlPoint {
 	x: number;
@@ -29,7 +30,9 @@ export class Triangle {
 	getNormal( target: Vector3 ): Vector3;
 	getPlane( target: Vector3 ): Plane;
 	getBarycoord( point: Vector3, target: Vector3 ): Vector3;
+	getUV( point: Vector3, uv1: Vector2, uv2: Vector2, uv3: Vector2, target: Vector2 ): Vector2;
 	containsPoint( point: Vector3 ): boolean;
+	intersectsBox( box: Box3 ): boolean;
 	isFrontFacing( direction: Vector3 ): boolean;
 	closestPointToPoint( point: Vector3, target: Vector3 ): Vector3;
 	equals( triangle: Triangle ): boolean;
@@ -53,6 +56,16 @@ export class Triangle {
 		b: Vector3,
 		c: Vector3
 	): boolean;
+	static getUV(
+		point: Vector3,
+		p1: Vector3,
+		p2: Vector3,
+		p3: Vector3,
+		uv1: Vector2,
+		uv2: Vector2,
+		uv3: Vector2,
+		target: Vector2
+	): Vector2;
 	static isFrontFacing(
 		a: Vector3,
 		b: Vector3,

+ 4 - 4
src/math/Triangle.js

@@ -238,15 +238,15 @@ Object.assign( Triangle.prototype, {
 
 	},
 
-	containsPoint: function ( point ) {
+	getUV: function ( point, uv1, uv2, uv3, target ) {
 
-		return Triangle.containsPoint( point, this.a, this.b, this.c );
+		return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, target );
 
 	},
 
-	getUV: function ( point, uv1, uv2, uv3, result ) {
+	containsPoint: function ( point ) {
 
-		return Triangle.getUV( point, this.a, this.b, this.c, uv1, uv2, uv3, result );
+		return Triangle.containsPoint( point, this.a, this.b, this.c );
 
 	},