Kaynağa Gözat

Merge pull request #17245 from HoldYourWaffle/patch-1

Add type definition for cartesian conversion methods
Michael Herzog 6 yıl önce
ebeveyn
işleme
e785f126df
2 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  1. 3 2
      src/math/Spherical.d.ts
  2. 2 0
      src/math/Vector3.d.ts

+ 3 - 2
src/math/Spherical.d.ts

@@ -8,10 +8,11 @@ export class Spherical {
 	phi: number;
 	theta: number;
 
-	set( radius: number, phi: number, theta: number ): Spherical;
+	set( radius: number, phi: number, theta: number ): this;
 	clone(): this;
 	copy( other: Spherical ): this;
 	makeSafe(): void;
-	setFromVector3( vec3: Vector3 ): Spherical;
+	setFromVector3( v: Vector3 ): this;
+	setFromCartesianCoords( x: number, y: number, z: number ): this;
 
 }

+ 2 - 0
src/math/Vector3.d.ts

@@ -236,7 +236,9 @@ export class Vector3 implements Vector {
 	distanceToManhattan( v: Vector3 ): number;
 
 	setFromSpherical( s: Spherical ): this;
+	setFromSphericalCoords( r: number, phi: number, theta:number ): this;
 	setFromCylindrical( s: Cylindrical ): this;
+	setFromCylindricalCoords( radius: number, theta: number, y: number ): this;
 	setFromMatrixPosition( m: Matrix4 ): this;
 	setFromMatrixScale( m: Matrix4 ): this;
 	setFromMatrixColumn( matrix: Matrix4, index: number ): this;