diff --git a/build/three.js b/build/three.js index 8630d6e4d9036f5c586e78b0dfc3d0d326ae38e8..ed40b0442f946ffa972198d39c17a27531c4b5b0 100644 --- a/build/three.js +++ b/build/three.js @@ -2909,16 +2909,16 @@ THREE.Vector4.prototype = { * @author mrdoob / http://mrdoob.com/ */ -THREE.TypedVector2 = function ( array, offset ) { +THREE.ProxyVector2 = function ( array, offset ) { this.array = array; this.offset = offset; }; -THREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype ); +THREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype ); -Object.defineProperties( THREE.TypedVector2.prototype, { +Object.defineProperties( THREE.ProxyVector2.prototype, { 'x': { get: function () { return this.array[ this.offset ]; }, set: function ( v ) { this.array[ this.offset ] = v; } @@ -2932,16 +2932,16 @@ Object.defineProperties( THREE.TypedVector2.prototype, { * @author mrdoob / http://mrdoob.com/ */ -THREE.TypedVector3 = function ( array, offset ) { +THREE.ProxyVector3 = function ( array, offset ) { this.array = array; this.offset = offset; }; -THREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype ); +THREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype ); -Object.defineProperties( THREE.TypedVector3.prototype, { +Object.defineProperties( THREE.ProxyVector3.prototype, { 'x': { get: function () { return this.array[ this.offset ]; }, set: function ( v ) { this.array[ this.offset ] = v; } @@ -9995,9 +9995,9 @@ THREE.BufferGeometryManipulator = function ( bufferGeometry ) { for ( var i = 0; i < length; i ++ ) { - this.vertices.push( new THREE.TypedVector3( attributes.position.array, i * 3 ) ); - this.normals.push( new THREE.TypedVector3( attributes.normal.array, i * 3 ) ); - this.uvs.push( new THREE.TypedVector2( attributes.uv.array, i * 2 ) ); + this.vertices.push( new THREE.ProxyVector3( attributes.position.array, i * 3 ) ); + this.normals.push( new THREE.ProxyVector3( attributes.normal.array, i * 3 ) ); + this.uvs.push( new THREE.ProxyVector2( attributes.uv.array, i * 2 ) ); } diff --git a/build/three.min.js b/build/three.min.js index fb88b7af272b74dcb828cfbb011800ef4b75799f..d8e99d096c4a2e41923e22298fae904b21cabbbc 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -59,7 +59,7 @@ a.y);this.zthis.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z): Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z, -this.w)}};THREE.TypedVector2=function(a,b){this.array=a;this.offset=b};THREE.TypedVector2.prototype=Object.create(THREE.Vector2.prototype);Object.defineProperties(THREE.TypedVector2.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}}});THREE.TypedVector3=function(a,b){this.array=a;this.offset=b};THREE.TypedVector3.prototype=Object.create(THREE.Vector3.prototype);Object.defineProperties(THREE.TypedVector3.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},z:{get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +this.w)}};THREE.ProxyVector2=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector2.prototype=Object.create(THREE.Vector2.prototype);Object.defineProperties(THREE.ProxyVector2.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}}});THREE.ProxyVector3=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector3.prototype=Object.create(THREE.Vector3.prototype);Object.defineProperties(THREE.ProxyVector3.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},z:{get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,_quaternion:void 0,_updateQuaternion:function(){void 0!==this._quaternion&&this._quaternion.setFromEuler(this,!1)},get x(){return this._x},set x(a){this._x=a;this._updateQuaternion()},get y(){return this._y},set y(a){this._y=a;this._updateQuaternion()},get z(){return this._z},set z(a){this._z=a;this._updateQuaternion()},get order(){return this._order},set order(a){this._order=a;this._updateQuaternion()}, set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._updateQuaternion();return this},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._updateQuaternion();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],r=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x= Math.atan2(r,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(r,-1,1)),0.99999>Math.abs(r)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(r,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h, @@ -200,7 +200,7 @@ P[n].start;da=P[n].count;var ga=P[n].index,g=R;for(R+=da;gq;q++)u=a[3*c+q],-1==p[u]?(r[2*q]=u,r[2*q+1]=-1,n++):p[u]k.index+b)for(k={start:f,count:0,index:g},h.push(k),n=0;6>n;n+=2)q=r[n+1],-1n;n+=2)u=r[n],q=r[n+1],-1===q&&(q=g++), p[u]=q,s[q]=u,e[f++]=q-k.index,k.count++}this.reorderBuffers(e,s,g);return this.offsets=h},reorderBuffers:function(a,b,c){var d={},e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],f;for(f in this.attributes)if("index"!=f)for(var g=this.attributes[f].array,h=0,k=e.length;h