提交 777e3664 编写于 作者: G gero3

add addScaledVector

上级 7dcec4c5
<!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.
......
<!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.
......
<!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.
......
......@@ -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 ) {
......
......@@ -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 ) {
......
......@@ -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 ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册