提交 09bdf44c 编写于 作者: M Mr.doob

Vector*: Clean up.

上级 af6a8177
......@@ -16,11 +16,29 @@ THREE.Vector2.prototype = {
constructor: THREE.Vector2,
get width() { return this.x },
set width( value ) { this.x = value },
get width() {
get height() { return this.y },
set height( value ) { this.y = value },
return this.x;
},
set width( value ) {
this.x = value;
},
get height() {
return this.y;
},
set height( value ) {
this.y = value;
},
//
......@@ -186,11 +204,15 @@ THREE.Vector2.prototype = {
multiplyScalar: function ( scalar ) {
if ( isFinite( scalar ) ) {
this.x *= scalar;
this.y *= scalar;
} else {
this.x = 0;
this.y = 0;
}
return this;
......
......@@ -209,13 +209,17 @@ THREE.Vector3.prototype = {
multiplyScalar: function ( scalar ) {
if ( isFinite( scalar ) ) {
this.x *= scalar;
this.y *= scalar;
this.z *= scalar;
} else {
this.x = 0;
this.y = 0;
this.z = 0;
}
return this;
......
......@@ -212,15 +212,19 @@ THREE.Vector4.prototype = {
multiplyScalar: function ( scalar ) {
if ( isFinite( scalar ) ) {
this.x *= scalar;
this.y *= scalar;
this.z *= scalar;
this.w *= scalar;
} else {
this.x = 0;
this.y = 0;
this.z = 0;
this.w = 0;
}
return this;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册