Selaa lähdekoodia

add addScaledVector

gero3 10 vuotta sitten
vanhempi
commit
777e366453

+ 6 - 1
docs/api/math/Vector2.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
@@ -63,6 +63,11 @@
 		Sets this vector to *a + b*.
 		</div>
 
+		<h3>[method:Vector2 addScaledVector]( [page:Vector2 v], [page:Float s] ) [page:Vector2 this]</h3>
+		<div>
+		Adds the multiple of v and s to this vector.
+		</div>
+
 		<h3>[method:Vector2 sub]( [page:Vector2 v] ) [page:Vector2 this]</h3>
 		<div>
 		Subtracts *v* from this vector.

+ 6 - 1
docs/api/math/Vector3.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
@@ -83,6 +83,11 @@
 		Sets this vector to *a + b*.
 		</div>
 
+		<h3>[method:Vector3 addScaledVector]( [page:Vector3 v], [page:Float s] ) [page:Vector3 this]</h3>
+		<div>
+		Adds the multiple of v and s to this vector.
+		</div>
+
 		<h3>[method:Vector3 sub]( [page:Vector3 v] ) [page:Vector3 this]</h3>
 		<div>
 		Subtracts *v* from this vector.

+ 6 - 1
docs/api/math/Vector4.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en">
 	<head>
-		<meta charset="utf-8" />
+		<meta charset="utf-8" />
 		<base href="../../" />
 		<script src="list.js"></script>
 		<script src="page.js"></script>
@@ -58,6 +58,11 @@
 		Sets this vector to *a + b*.
 		</div>
 
+		<h3>[method:Vector4 addScaledVector]( [page:Vector4 v], [page:Float s] ) [page:Vector4 this]</h3>
+		<div>
+		Adds the multiple of v and s to this vector.
+		</div>
+
 		<h3>[method:Vector4 sub]( [page:Vector4 v] )</h3>
 		<div>
 		Subtracts *v* from this vector.

+ 9 - 0
src/math/Vector2.js

@@ -107,6 +107,15 @@ THREE.Vector2.prototype = {
 		return this;
 
 	},
+	
+	addScaledVector: function ( v, s ) {
+
+        this.x += v.x * s;
+        this.y += v.y * s;
+
+        return this;
+
+    },
 
 	sub: function ( v, w ) {
 

+ 10 - 0
src/math/Vector3.js

@@ -125,6 +125,16 @@ THREE.Vector3.prototype = {
 		return this;
 
 	},
+	
+	addScaledVector: function ( v, s ) {
+
+        this.x += v.x * s;
+        this.y += v.y * s;
+        this.z += v.z * s;
+
+        return this;
+
+    },
 
 	sub: function ( v, w ) {
 

+ 11 - 0
src/math/Vector4.js

@@ -140,6 +140,17 @@ THREE.Vector4.prototype = {
 		return this;
 
 	},
+	
+	addScaledVector: function ( v, s ) {
+
+        this.x += v.x * s;
+        this.y += v.y * s;
+        this.z += v.z * s;
+        this.w += v.w * s;
+
+        return this;
+
+    },
 
 	sub: function ( v, w ) {