Переглянути джерело

Hard tabs and updated docs.

EthanHermsey 5 роки тому
батько
коміт
21599238f2

+ 5 - 0
docs/api/en/math/Vector2.html

@@ -331,6 +331,11 @@
 
 		Returns an array [x, y], or copies x and y into the provided [page:Array array].
 		</p>
+		
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x and y components of the vector to a random value [0-1].
+		</p>
 
 		<h2>Source</h2>
 

+ 4 - 0
docs/api/en/math/Vector3.html

@@ -437,6 +437,10 @@
 		Projects this vector from the camera's normalized device coordinate (NDC) space into world space.
 		</p>
 
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x, y and z components of the vector to a random value [0-1].
+		</p>
 
 		<h2>Source</h2>
 

+ 5 - 0
docs/api/en/math/Vector4.html

@@ -323,6 +323,11 @@
 		Returns an array [x, y, z, w], or copies x, y, z and w into the provided [page:Array array].
 		</p>
 
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x, y, z and w components of the vector to a random value [0-1].
+		</p>
+
 		<h2>Source</h2>
 
 		<p>

+ 5 - 0
docs/api/zh/math/Vector2.html

@@ -333,6 +333,11 @@
 		返回一个数组[x, y],或者将x和y复制到所传入的[page:Array array]中。
 		</p>
 
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x and y components of the vector to a random value [0-1].
+		</p>
+
 		<h2>源代码</h2>
 
 		<p>

+ 4 - 0
docs/api/zh/math/Vector3.html

@@ -426,6 +426,10 @@
 		Projects this vector from the camera's normalized device coordinate (NDC) space into world space.
 		</p>
 
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x, y and z components of the vector to a random value [0-1].
+		</p>
 
 		<h2>源代码</h2>
 

+ 5 - 0
docs/api/zh/math/Vector4.html

@@ -322,6 +322,11 @@
 		返回一个数组[x, y, z, w],或者将x、y、z和w复制到所传入的[page:Array array]中。
 		</p>
 
+		<h3>[method:this random]()</h3>
+		<p>
+			Sets the x, y, z and w components of the vector to a random value [0-1].
+		</p>
+
 		<h2>源代码</h2>
 
 		<p>

+ 3 - 3
src/math/Vector2.d.ts

@@ -457,9 +457,9 @@ export class Vector2 implements Vector {
 	 *
 	 * @see {@link http://en.wikipedia.org/wiki/Taxicab_geometry|Wikipedia: Taxicab Geometry}
 	 */
-    manhattanDistanceTo( v: Vector2 ): number;
-    
-    /**
+	manhattanDistanceTo( v: Vector2 ): number;
+
+	/**
 	 * Sets this vector's x and y from Math.random
 	 */
 	random(): this;

+ 7 - 7
src/math/Vector2.js

@@ -482,16 +482,16 @@ Object.assign( Vector2.prototype, {
 
 		return this;
 
-    },
-    
-    random: function () {
+	},
+	
+	random: function () {
 
-        this.x = Math.random();
-        this.y = Math.random();
+		this.x = Math.random();
+		this.y = Math.random();
 
-        return this;
+		return this;
 
-    }
+	}
 
 } );
 

+ 3 - 3
src/math/Vector3.d.ts

@@ -285,9 +285,9 @@ export class Vector3 implements Vector {
 		attribute: BufferAttribute,
 		index: number,
 		offset?: number
-    ): this;
-    
-    /**
+	): this;
+	
+	/**
 	 * Sets this vector's x, y and z from Math.random
 	 */
 	random(): this;

+ 8 - 8
src/math/Vector3.js

@@ -713,16 +713,16 @@ Object.assign( Vector3.prototype, {
 		return this;
 
 	},
-    
-    random: function () {
+	
+	random: function () {
 
-        this.x = Math.random();
-        this.y = Math.random();
-        this.z = Math.random();
+		this.x = Math.random();
+		this.y = Math.random();
+		this.z = Math.random();
 
-        return this;
-        
-    }
+		return this;
+		
+	}
 
 } );
 

+ 3 - 3
src/math/Vector4.d.ts

@@ -208,9 +208,9 @@ export class Vector4 implements Vector {
 		attribute: BufferAttribute,
 		index: number,
 		offset?: number
-    ): this;
-    
-    /**
+	): this;
+	
+	/**
 	 * Sets this vector's x, y, z and w from Math.random
 	 */
 	random(): this;

+ 16 - 16
src/math/Vector4.js

@@ -323,17 +323,17 @@ Object.assign( Vector4.prototype, {
 			m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];
 
 		if ( ( Math.abs( m12 - m21 ) < epsilon ) &&
-		     ( Math.abs( m13 - m31 ) < epsilon ) &&
-		     ( Math.abs( m23 - m32 ) < epsilon ) ) {
+			 ( Math.abs( m13 - m31 ) < epsilon ) &&
+			 ( Math.abs( m23 - m32 ) < epsilon ) ) {
 
 			// singularity found
 			// first check for identity matrix which must have +1 for all terms
 			// in leading diagonal and zero in other terms
 
 			if ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&
-			     ( Math.abs( m13 + m31 ) < epsilon2 ) &&
-			     ( Math.abs( m23 + m32 ) < epsilon2 ) &&
-			     ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {
+				 ( Math.abs( m13 + m31 ) < epsilon2 ) &&
+				 ( Math.abs( m23 + m32 ) < epsilon2 ) &&
+				 ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {
 
 				// this singularity is identity matrix so angle = 0
 
@@ -419,8 +419,8 @@ Object.assign( Vector4.prototype, {
 		// as we have reached here there are no singularities so we can handle normally
 
 		var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +
-		                   ( m13 - m31 ) * ( m13 - m31 ) +
-		                   ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize
+						   ( m13 - m31 ) * ( m13 - m31 ) +
+						   ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize
 
 		if ( Math.abs( s ) < 0.001 ) s = 1;
 
@@ -647,17 +647,17 @@ Object.assign( Vector4.prototype, {
 		return this;
 
 	},
-    
-    random: function () {
+	
+	random: function () {
 
-        this.x = Math.random();
-        this.y = Math.random();
-        this.z = Math.random();
-        this.w = Math.random();
+		this.x = Math.random();
+		this.y = Math.random();
+		this.z = Math.random();
+		this.w = Math.random();
 
-        return this;
-        
-    }
+		return this;
+		
+	}
 
 } );