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

Updated builds.

上级 53161648
......@@ -10664,35 +10664,44 @@ THREE.Geometry99 = function ( ) {
THREE.Geometry99.prototype = Object.create( THREE.BufferGeometry.prototype );
Object.defineProperties( THREE.Geometry99.prototype, {
vertices: {
enumerable: true,
get: function() { return this.createVertexProxies(); }
get: function () { return this.createVertexProxies(); }
},
faces: {
enumerable: true,
get: function() { return this.createFaceProxies() }
enumerable: true,
get: function () { return this.createFaceProxies() }
},
faceVertexUvs: {
enumerable: true,
get: function() { return this.createUvProxies() }
}
enumerable: true,
get: function () { return this.createUvProxies() }
},
// TODO - fill in additional proxies:
// - colors
// - morphColors
// - morphNormals
// - morphTargets
// - skinIndex
// - skinWeights
} );
THREE.Geometry99.prototype.createVertexProxies = function() {
verticesNeedUpdate: {
enumerable: true,
get: function () { return this.attributes[ 'position' ].needsUpdate; } ,
set: function ( v ) { this.attributes[ 'position' ].needsUpdate = v; }
},
colorsNeedUpdate: {
enumerable: true,
get: function () { if ( this.attributes[ 'color' ] ) return this.attributes[ 'color' ].needsUpdate; } ,
set: function ( v ) { if ( this.attributes[ 'color' ] ) this.attributes[ 'color' ].needsUpdate = v; }
},
normalsNeedUpdate: {
enumerable: true,
get: function () { if ( this.attributes[ 'normal' ] ) return this.attributes[ 'normal' ].needsUpdate; } ,
set: function ( v ) { if ( this.attributes[ 'normal' ] ) this.attributes[ 'normal' ].needsUpdate = v; }
},
});
THREE.Geometry99.prototype.createVertexProxies = function () {
// Replace the prototype getter with a local array property
......@@ -10700,13 +10709,13 @@ THREE.Geometry99.prototype.createVertexProxies = function() {
// If the attribute buffer has already been populated, set up proxy objects
this.populateProxyFromBuffer( this.vertices, "position", THREE.ProxyVector3, 3 );
this.populateProxyFromBuffer( this.vertices, "position", THREE.TypedVector3, 3 );
// Return a reference to the newly-created array
return this.vertices;
};
}
THREE.Geometry99.prototype.createFaceProxies = function () {
......@@ -10716,47 +10725,101 @@ THREE.Geometry99.prototype.createFaceProxies = function () {
// If the attribute buffer has already been populated, set up proxy objects
var faces = this.faces,
indexarray = false,
positionarray = false,
normalarray = false,
colorarray = false;
if ( this.attributes.position ) {
positionarray = this.attributes[ 'position' ].array;
}
if ( this.attributes.index ) {
indexarray = this.attributes[ 'index' ].array;
}
if (this.attributes[ 'normal' ]) {
normalarray = this.attributes[ 'normal' ].array;
}
if (this.attributes[ 'color' ]) {
colorarray = this.attributes[ 'color' ].array;
}
if (indexarray) {
for ( var i = 0, l = indexarray.length / 3; i < l; i ++ ) {
var o = i * 3;
// Generate face.vertexNormals and face.vertexFaceColors
var vertexNormals = false,
vertexColors = false;
if (normalarray) {
vertexNormals = [
new THREE.TypedVector3(normalarray, indexarray[o] * 3),
new THREE.TypedVector3(normalarray, indexarray[o+1] * 3),
new THREE.TypedVector3(normalarray, indexarray[o+2] * 3),
]
var indexarray = this.attributes[ 'index' ].array;
var size = 3;
var attr = this.faces;
}
// TODO - do BufferGeometries support face normals?
if (colorarray) {
var normalarray = false;
vertexColors = [
new THREE.TypedColor(colorarray, indexarray[o] * 3),
new THREE.TypedColor(colorarray, indexarray[o+1] * 3),
new THREE.TypedColor(colorarray, indexarray[o+2] * 3),
]
if (this.attributes[ 'normal' ]) {
}
normalarray = this.attributes[ 'normal' ].array;
var face = new THREE.TypedFace3( indexarray, i * 3, vertexNormals );
}
for ( var i = 0, l = indexarray.length / size; i < l; i ++ ) {
} else {
for ( var i = 0, l = positionarray.length / 3; i < l; i += 3 ) {
var o = i * size;
var o = i * 3;
// Generate faceVertexNormals
var vertexNormals;
var v1 = i, v2 = i+1, v3 = i+2;
// Generate face.vertexNormals and face.vertexColors
// TODO - do BufferGeometries support face normals/face colors?
// Maybe they could be implemented using some sort of TypedMultiVector3 which would let us expose a single
// face.normal Vector3, and it would simultaneously update the three vertexNormals involved in this face with the same values
var vertexNormals = false,
vertexColors = false;
if (normalarray) {
vertexNormals = [
new THREE.ProxyVector3( normalarray, indexarray[ o ] * 3 ),
new THREE.ProxyVector3( normalarray, indexarray[ o + 1 ] * 3 ),
new THREE.ProxyVector3( normalarray, indexarray[ o + 2 ] * 3 )
]
new THREE.TypedVector3(normalarray, o),
new THREE.TypedVector3(normalarray, o+3),
new THREE.TypedVector3(normalarray, o+6),
];
}
// TODO - do BufferGeometries support face normals?
if (colorarray) {
var face = new THREE.ProxyFace3( indexarray, i * size, vertexNormals );
vertexColors = [
new THREE.TypedColor(colorarray, o),
new THREE.TypedColor(colorarray, o+3),
new THREE.TypedColor(colorarray, o+6),
];
attr.push( face );
}
}
var face = new THREE.Face3( v1, v2, v3, vertexNormals, vertexColors );
} else {
faces.push(face);
// TODO - should be able to generate Face data even for non-indexed geometries
}
}
......@@ -10764,8 +10827,7 @@ THREE.Geometry99.prototype.createFaceProxies = function () {
return this.faces;
};
}
THREE.Geometry99.prototype.createUvProxies = function () {
// Replace the prototype getter with a local array property
......@@ -10783,9 +10845,9 @@ THREE.Geometry99.prototype.createUvProxies = function () {
var f = faces[i];
this.faceVertexUvs[0][i] = [];
this.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, f.a * 2);
this.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, f.b * 2);
this.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, f.c * 2);
this.faceVertexUvs[0][i][0] = new THREE.TypedVector2(uvarray, f.a * 2);
this.faceVertexUvs[0][i][1] = new THREE.TypedVector2(uvarray, f.b * 2);
this.faceVertexUvs[0][i][2] = new THREE.TypedVector2(uvarray, f.c * 2);
}
......@@ -10795,7 +10857,7 @@ THREE.Geometry99.prototype.createUvProxies = function () {
return this.faceVertexUvs;
};
}
THREE.Geometry99.prototype.populateProxyFromBuffer = function ( attr, buffername, proxytype, itemsize, offset, count ) {
......@@ -10804,7 +10866,7 @@ THREE.Geometry99.prototype.populateProxyFromBuffer = function ( attr, buffername
var array = this.attributes[ buffername ].array;
var size = itemsize || this.attributes[ buffername ].itemSize;
var start = offset || 0;
count = count || ( array.length / size - start );
for ( var i = start, l = start + count; i < l; i ++ ) {
......@@ -10815,38 +10877,20 @@ THREE.Geometry99.prototype.populateProxyFromBuffer = function ( attr, buffername
}
};
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.IndexedGeometry2 = function ( indices, vertices, normals, uvs ) {
THREE.BufferGeometry.call( this );
this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
};
THREE.IndexedGeometry2.prototype = Object.create( THREE.Geometry99.prototype );
}
/**
* @author mrdoob / http://mrdoob.com/
*/
// Proxies
THREE.ProxyVector2 = function ( array, offset ) {
THREE.TypedVector2 = function ( array, offset ) {
this.array = array;
this.offset = offset;
};
THREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype );
THREE.TypedVector2.prototype = Object.create( THREE.Vector2.prototype );
Object.defineProperties( THREE.ProxyVector2.prototype, {
Object.defineProperties( THREE.TypedVector2.prototype, {
'x': {
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
......@@ -10856,20 +10900,20 @@ Object.defineProperties( THREE.ProxyVector2.prototype, {
set: function ( v ) { this.array[ this.offset + 1 ] = v; }
}
} );
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.ProxyVector3 = function ( array, offset ) {
//
THREE.TypedVector3 = function ( array, offset ) {
this.array = array;
this.offset = offset;
};
THREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype );
THREE.TypedVector3.prototype = Object.create( THREE.Vector3.prototype );
Object.defineProperties( THREE.ProxyVector3.prototype, {
Object.defineProperties( THREE.TypedVector3.prototype, {
'x': {
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
......@@ -10883,11 +10927,10 @@ Object.defineProperties( THREE.ProxyVector3.prototype, {
set: function ( v ) { this.array[ this.offset + 2 ] = v; }
}
} );
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.ProxyFace3 = function ( array, offset, vertexNormals ) {
//
THREE.TypedFace3 = function ( array, offset, vertexNormals ) {
this.array = array;
this.offset = offset;
......@@ -10897,25 +10940,67 @@ THREE.ProxyFace3 = function ( array, offset, vertexNormals ) {
}
THREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype );
THREE.TypedFace3.prototype = Object.create( THREE.Face3.prototype );
Object.defineProperties( THREE.ProxyFace3.prototype, {
Object.defineProperties( THREE.TypedFace3.prototype, {
'a': {
enumerable: true,
enumerable: true,
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
},
'b': {
enumerable: true,
enumerable: true,
get: function () { return this.array[ this.offset + 1 ]; },
set: function ( v ) { this.array[ this.offset + 1 ] = v; }
},
'c': {
enumerable: true,
enumerable: true,
get: function () { return this.array[ this.offset + 2 ]; },
set: function ( v ) { this.array[ this.offset + 2 ] = v; }
},
} );
THREE.TypedColor = function ( array, offset ) {
this.array = array;
this.offset = offset;
}
THREE.TypedColor.prototype = Object.create( THREE.Color.prototype );
Object.defineProperties( THREE.TypedColor.prototype, {
'r': {
enumerable: true,
get: function () { return this.array[ this.offset ]; },
set: function ( v ) { this.array[ this.offset ] = v; }
},
'g': {
enumerable: true,
get: function () { return this.array[ this.offset + 1 ]; },
set: function ( v ) { this.array[ this.offset + 1 ] = v; }
},
'b': {
enumerable: true,
get: function () { return this.array[ this.offset + 2 ]; },
set: function ( v ) { this.array[ this.offset + 2 ] = v; }
}
} );
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.IndexedGeometry2 = function ( indices, vertices, normals, uvs ) {
THREE.BufferGeometry.call( this );
this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
};
THREE.IndexedGeometry2.prototype = Object.create( THREE.Geometry99.prototype );
/**
* @author mrdoob / http://mrdoob.com/
* @author mikael emtinger / http://gomo.se/
......
......@@ -214,12 +214,17 @@ this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoin
c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k=this.morphTargets.length,l=this.morphNormals.length;this.geometryGroups=
{};d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l}),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l})),this.geometryGroups[g].faces3.push(d),
this.geometryGroups[g].vertices+=3;this.geometryGroupsList=[];for(var n in this.geometryGroups)this.geometryGroups[n].id=a++,this.geometryGroupsList.push(this.geometryGroups[n])}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Geometry2=function(a,b,c){THREE.BufferGeometry.call(this);this.attributes.position={array:a,itemSize:3};this.attributes.normal={array:b,itemSize:3};this.attributes.uv={array:c,itemSize:2}};THREE.Geometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.Geometry99=function(){THREE.BufferGeometry.call(this)};THREE.Geometry99.prototype=Object.create(THREE.BufferGeometry.prototype);Object.defineProperties(THREE.Geometry99.prototype,{vertices:{enumerable:!0,get:function(){return this.createVertexProxies()}},faces:{enumerable:!0,get:function(){return this.createFaceProxies()}},faceVertexUvs:{enumerable:!0,get:function(){return this.createUvProxies()}}});
THREE.Geometry99.prototype.createVertexProxies=function(){Object.defineProperty(this,"vertices",{value:[]});this.populateProxyFromBuffer(this.vertices,"position",THREE.ProxyVector3,3);return this.vertices};
THREE.Geometry99.prototype.createFaceProxies=function(){Object.defineProperty(this,"faces",{value:[]});if(this.attributes.index){var a=this.attributes.index.array,b=this.faces,c=!1;this.attributes.normal&&(c=this.attributes.normal.array);for(var d=0,e=a.length/3;d<e;d++){var f=3*d,g;c&&(g=[new THREE.ProxyVector3(c,3*a[f]),new THREE.ProxyVector3(c,3*a[f+1]),new THREE.ProxyVector3(c,3*a[f+2])]);f=new THREE.ProxyFace3(a,3*d,g);b.push(f)}}return this.faces};
THREE.Geometry99.prototype.createUvProxies=function(){Object.defineProperty(this,"faceVertexUvs",{value:[[]]});if(this.attributes.uv)for(var a=this.faces,b=this.attributes.uv.array,c=0,d=a.length;c<d;c++){var e=a[c];this.faceVertexUvs[0][c]=[];this.faceVertexUvs[0][c][0]=new THREE.ProxyVector2(b,2*e.a);this.faceVertexUvs[0][c][1]=new THREE.ProxyVector2(b,2*e.b);this.faceVertexUvs[0][c][2]=new THREE.ProxyVector2(b,2*e.c)}return this.faceVertexUvs};
THREE.Geometry99.prototype.populateProxyFromBuffer=function(a,b,c,d,e,f){if(this.attributes[b]){var g=this.attributes[b].array;b=d||this.attributes[b].itemSize;d=e||0;f=f||g.length/b-d;e=d;for(f=d+f;e<f;e++)a.push(new c(g,e*b))}};THREE.IndexedGeometry2=function(a,b,c,d){THREE.BufferGeometry.call(this);this.attributes.index={array:a,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:c,itemSize:3};this.attributes.uv={array:d,itemSize:2}};THREE.IndexedGeometry2.prototype=Object.create(THREE.Geometry99.prototype);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.ProxyFace3=function(a,b,c){this.array=a;this.offset=b;this.vertexNormals=c};THREE.ProxyFace3.prototype=Object.create(THREE.Face3.prototype);
Object.defineProperties(THREE.ProxyFace3.prototype,{a:{enumerable:!0,get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},b:{enumerable:!0,get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},c:{enumerable:!0,get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Geometry2=function(a,b,c){THREE.BufferGeometry.call(this);this.attributes.position={array:a,itemSize:3};this.attributes.normal={array:b,itemSize:3};this.attributes.uv={array:c,itemSize:2}};THREE.Geometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.Geometry99=function(){THREE.BufferGeometry.call(this)};THREE.Geometry99.prototype=Object.create(THREE.BufferGeometry.prototype);
Object.defineProperties(THREE.Geometry99.prototype,{vertices:{enumerable:!0,get:function(){return this.createVertexProxies()}},faces:{enumerable:!0,get:function(){return this.createFaceProxies()}},faceVertexUvs:{enumerable:!0,get:function(){return this.createUvProxies()}},verticesNeedUpdate:{enumerable:!0,get:function(){return this.attributes.position.needsUpdate},set:function(a){this.attributes.position.needsUpdate=a}},colorsNeedUpdate:{enumerable:!0,get:function(){if(this.attributes.color)return this.attributes.color.needsUpdate},
set:function(a){this.attributes.color&&(this.attributes.color.needsUpdate=a)}},normalsNeedUpdate:{enumerable:!0,get:function(){if(this.attributes.normal)return this.attributes.normal.needsUpdate},set:function(a){this.attributes.normal&&(this.attributes.normal.needsUpdate=a)}}});THREE.Geometry99.prototype.createVertexProxies=function(){Object.defineProperty(this,"vertices",{value:[]});this.populateProxyFromBuffer(this.vertices,"position",THREE.TypedVector3,3);return this.vertices};
THREE.Geometry99.prototype.createFaceProxies=function(){Object.defineProperty(this,"faces",{value:[]});var a=this.faces,b=!1,c=!1,d=!1,e=!1;this.attributes.position&&(c=this.attributes.position.array);this.attributes.index&&(b=this.attributes.index.array);this.attributes.normal&&(d=this.attributes.normal.array);this.attributes.color&&(e=this.attributes.color.array);if(b)for(var f=0,c=b.length/3;f<c;f++){var g=3*f,h=!1,k=!1;d&&(h=[new THREE.TypedVector3(d,3*b[g]),new THREE.TypedVector3(d,3*b[g+1]),
new THREE.TypedVector3(d,3*b[g+2])]);e&&(new THREE.TypedColor(e,3*b[g]),new THREE.TypedColor(e,3*b[g+1]),new THREE.TypedColor(e,3*b[g+2]));g=new THREE.TypedFace3(b,3*f,h)}else for(f=0,c=c.length/3;f<c;f+=3){var g=3*f,b=f,l=f+1,n=f+2,k=h=!1;d&&(h=[new THREE.TypedVector3(d,g),new THREE.TypedVector3(d,g+3),new THREE.TypedVector3(d,g+6)]);e&&(k=[new THREE.TypedColor(e,g),new THREE.TypedColor(e,g+3),new THREE.TypedColor(e,g+6)]);g=new THREE.Face3(b,l,n,h,k);a.push(g)}return this.faces};
THREE.Geometry99.prototype.createUvProxies=function(){Object.defineProperty(this,"faceVertexUvs",{value:[[]]});if(this.attributes.uv)for(var a=this.faces,b=this.attributes.uv.array,c=0,d=a.length;c<d;c++){var e=a[c];this.faceVertexUvs[0][c]=[];this.faceVertexUvs[0][c][0]=new THREE.TypedVector2(b,2*e.a);this.faceVertexUvs[0][c][1]=new THREE.TypedVector2(b,2*e.b);this.faceVertexUvs[0][c][2]=new THREE.TypedVector2(b,2*e.c)}return this.faceVertexUvs};
THREE.Geometry99.prototype.populateProxyFromBuffer=function(a,b,c,d,e,f){if(this.attributes[b]){var g=this.attributes[b].array;b=d||this.attributes[b].itemSize;d=e||0;f=f||g.length/b-d;e=d;for(f=d+f;e<f;e++)a.push(new c(g,e*b))}};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.TypedFace3=function(a,b,c){this.array=a;this.offset=b;this.vertexNormals=c};THREE.TypedFace3.prototype=Object.create(THREE.Face3.prototype);
Object.defineProperties(THREE.TypedFace3.prototype,{a:{enumerable:!0,get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},b:{enumerable:!0,get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},c:{enumerable:!0,get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.TypedColor=function(a,b){this.array=a;this.offset=b};THREE.TypedColor.prototype=Object.create(THREE.Color.prototype);
Object.defineProperties(THREE.TypedColor.prototype,{r:{enumerable:!0,get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},g:{enumerable:!0,get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},b:{enumerable:!0,get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.IndexedGeometry2=function(a,b,c,d){THREE.BufferGeometry.call(this);this.attributes.index={array:a,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:c,itemSize:3};this.attributes.uv={array:d,itemSize:2}};THREE.IndexedGeometry2.prototype=Object.create(THREE.Geometry99.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册