mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-19 18:05:57 +10:00
There don't seem to be any effects on performance (though I'm not sure this was actually used in any example/test code path - so far quaternions are used just for animation interpolation and even there they were always dirty, and also just updated during JIT baking). Also some more code cleanup - no need for Mesh to have own "update" as now it was exactly the same as its parent Object3D.
38 lines
803 B
JavaScript
38 lines
803 B
JavaScript
/**
|
|
* @author mr.doob / http://mrdoob.com/
|
|
* @author alteredq / http://alteredqualia.com/
|
|
* @author mikael emtinger / http://gomo.se/
|
|
*/
|
|
|
|
THREE.Mesh = function( geometry, materials ) {
|
|
|
|
THREE.Object3D.call( this );
|
|
|
|
this.geometry = geometry;
|
|
this.materials = materials && materials.length ? materials : [ materials ];
|
|
|
|
this.flipSided = false;
|
|
this.doubleSided = false;
|
|
|
|
this.overdraw = false; // TODO: Move to material?
|
|
|
|
// calc bound radius
|
|
|
|
if( this.geometry ) {
|
|
|
|
if( !this.geometry.boundingSphere )
|
|
this.geometry.computeBoundingSphere();
|
|
|
|
this.boundRadius = geometry.boundingSphere.radius;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
THREE.Mesh.prototype = new THREE.Object3D();
|
|
THREE.Mesh.prototype.constructor = THREE.Mesh;
|
|
THREE.Mesh.prototype.supr = THREE.Object3D.prototype;
|
|
|
|
|
|
|