| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /**
- * @author supereggbert / http://www.paulbrunt.co.uk/
- * @author philogb / http://blog.thejit.org/
- */
- THREE.Vector4 = function ( x, y, z, w ) {
- this.x = x || 0;
- this.y = y || 0;
- this.z = z || 0;
- this.w = w || 1;
- };
- THREE.Vector4.prototype = {
- set: function ( x, y, z, w ) {
- this.x = x;
- this.y = y;
- this.z = z;
- this.w = w;
- },
- copy: function ( v ) {
- this.x = v.x;
- this.y = v.y;
- this.z = v.z;
- this.w = v.w;
- },
- add: function ( v1, v2 ) {
- this.x = v1.x + v2.x;
- this.y = v1.y + v2.y;
- this.z = v1.z + v2.z;
- this.w = v1.w + v2.w;
- },
- addSelf: function ( v ) {
- this.x += v.x;
- this.y += v.y;
- this.z += v.z;
- this.w += v.w;
- },
- sub: function ( v1, v2 ) {
- this.x = v1.x - v2.x;
- this.y = v1.y - v2.y;
- this.z = v1.z - v2.z;
- this.w = v1.w - v2.w;
- },
- subSelf: function ( v ) {
- this.x -= v.x;
- this.y -= v.y;
- this.z -= v.z;
- this.w -= v.w;
- },
- clone: function () {
- return new THREE.Vector4( this.x, this.y, this.z, this.w );
- },
- toString: function () {
- return 'THREE.Vector4 (' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')';
- }
- };
|