|
@@ -484,54 +484,72 @@ THREE.Vector4.prototype = {
|
|
|
},
|
|
|
|
|
|
clampScalar: ( function () {
|
|
|
+
|
|
|
var min, max;
|
|
|
|
|
|
return function ( minVal, maxVal ) {
|
|
|
- if ( !min || !max ) {
|
|
|
+
|
|
|
+ if ( min === undefined ) {
|
|
|
+
|
|
|
min = new THREE.Vector4();
|
|
|
max = new THREE.Vector4();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- min.set(minVal, minVal, minVal, minVal);
|
|
|
- max.set(maxVal, maxVal, maxVal, maxVal);
|
|
|
- return this.clamp(min, max);
|
|
|
+ min.set( minVal, minVal, minVal, minVal );
|
|
|
+ max.set( maxVal, maxVal, maxVal, maxVal );
|
|
|
+
|
|
|
+ return this.clamp( min, max );
|
|
|
|
|
|
};
|
|
|
+
|
|
|
} )(),
|
|
|
|
|
|
- floor: function() {
|
|
|
- this.x = Math.floor(this.x);
|
|
|
- this.y = Math.floor(this.y);
|
|
|
- this.z = Math.floor(this.z);
|
|
|
- this.w = Math.floor(this.w);
|
|
|
+ floor: function () {
|
|
|
+
|
|
|
+ this.x = Math.floor( this.x );
|
|
|
+ this.y = Math.floor( this.y );
|
|
|
+ this.z = Math.floor( this.z );
|
|
|
+ this.w = Math.floor( this.w );
|
|
|
+
|
|
|
return this;
|
|
|
+
|
|
|
},
|
|
|
|
|
|
- ceil: function() {
|
|
|
- this.x = Math.ceil(this.x);
|
|
|
- this.y = Math.ceil(this.y);
|
|
|
- this.z = Math.ceil(this.z);
|
|
|
- this.w = Math.ceil(this.w);
|
|
|
+ ceil: function () {
|
|
|
+
|
|
|
+ this.x = Math.ceil( this.x );
|
|
|
+ this.y = Math.ceil( this.y );
|
|
|
+ this.z = Math.ceil( this.z );
|
|
|
+ this.w = Math.ceil( this.w );
|
|
|
+
|
|
|
return this;
|
|
|
+
|
|
|
},
|
|
|
|
|
|
- round: function() {
|
|
|
- this.x = Math.round(this.x);
|
|
|
- this.y = Math.round(this.y);
|
|
|
- this.z = Math.round(this.z);
|
|
|
- this.w = Math.round(this.w);
|
|
|
+ round: function () {
|
|
|
+
|
|
|
+ this.x = Math.round( this.x );
|
|
|
+ this.y = Math.round( this.y );
|
|
|
+ this.z = Math.round( this.z );
|
|
|
+ this.w = Math.round( this.w );
|
|
|
+
|
|
|
return this;
|
|
|
+
|
|
|
},
|
|
|
|
|
|
- roundToZero: function() {
|
|
|
- this.x = (this.x < 0) ? Math.ceil(this.x) : Math.floor(this.x);
|
|
|
- this.y = (this.y < 0) ? Math.ceil(this.y) : Math.floor(this.y);
|
|
|
- this.z = (this.z < 0) ? Math.ceil(this.z) : Math.floor(this.z);
|
|
|
- this.w = (this.w < 0) ? Math.ceil(this.w) : Math.floor(this.w);
|
|
|
+ roundToZero: function () {
|
|
|
+
|
|
|
+ this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );
|
|
|
+ this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );
|
|
|
+ this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );
|
|
|
+ this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w );
|
|
|
+
|
|
|
return this;
|
|
|
+
|
|
|
},
|
|
|
|
|
|
- negate: function() {
|
|
|
+ negate: function () {
|
|
|
|
|
|
return this.multiplyScalar( -1 );
|
|
|
|