From a0b8f50fb0a3ce028c6f350dc623c9e594ec9bfb Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 4 Oct 2011 03:07:07 +0200 Subject: [PATCH] Renamed scene.center to scene.origin as per @pyrotechnick suggestion. --- build/Three.js | 2 +- build/custom/ThreeCanvas.js | 2 +- build/custom/ThreeDOM.js | 2 +- build/custom/ThreeSVG.js | 2 +- build/custom/ThreeWebGL.js | 2 +- examples/canvas_camera_orthographic.html | 2 +- examples/canvas_geometry_earth.html | 2 +- examples/canvas_geometry_hierarchy.html | 2 +- examples/canvas_geometry_panorama.html | 38 ++++++++------- .../canvas_geometry_panorama_fisheye.html | 46 ++++++++++--------- examples/canvas_geometry_terrain.html | 7 ++- examples/canvas_geometry_text.html | 2 +- examples/canvas_interactive_cubes.html | 5 +- examples/canvas_interactive_cubes_tween.html | 5 +- examples/canvas_interactive_particles.html | 4 +- examples/canvas_interactive_voxelpainter.html | 14 +++--- examples/canvas_lights_pointlights.html | 2 +- .../canvas_lights_pointlights_smooth.html | 2 +- examples/canvas_lines.html | 4 +- examples/canvas_lines_sphere.html | 4 +- examples/canvas_materials.html | 4 +- src/scenes/Scene.js | 2 +- 22 files changed, 81 insertions(+), 74 deletions(-) diff --git a/build/Three.js b/build/Three.js index 41100188..ec67891b 100644 --- a/build/Three.js +++ b/build/Three.js @@ -142,7 +142,7 @@ THREE.Sprite=function(b){THREE.Object3D.call(this);this.color=b.color!==void 0?n !this.useScreenCoordinates;this.scaleByViewport=b.scaleByViewport!==void 0?b.scaleByViewport:!this.affectedByDistance;this.alignment=b.alignment instanceof THREE.Vector2?b.alignment:THREE.SpriteAlignment.center;this.rotation3d=this.rotation;this.rotation=0;this.opacity=1;this.uvOffset=new THREE.Vector2(0,0);this.uvScale=new THREE.Vector2(1,1)};THREE.Sprite.prototype=new THREE.Object3D;THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.supr=THREE.Object3D.prototype; THREE.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position);this.rotation3d.set(0,0,this.rotation);this.matrix.setRotationFromEuler(this.rotation3d);if(this.scale.x!==1||this.scale.y!==1)this.matrix.scale(this.scale),this.boundRadiusScale=Math.max(this.scale.x,this.scale.y);this.matrixWorldNeedsUpdate=!0};THREE.SpriteAlignment={};THREE.SpriteAlignment.topLeft=new THREE.Vector2(1,-1);THREE.SpriteAlignment.topCenter=new THREE.Vector2(0,-1); THREE.SpriteAlignment.topRight=new THREE.Vector2(-1,-1);THREE.SpriteAlignment.centerLeft=new THREE.Vector2(1,0);THREE.SpriteAlignment.center=new THREE.Vector2(0,0);THREE.SpriteAlignment.centerRight=new THREE.Vector2(-1,0);THREE.SpriteAlignment.bottomLeft=new THREE.Vector2(1,1);THREE.SpriteAlignment.bottomCenter=new THREE.Vector2(0,1);THREE.SpriteAlignment.bottomRight=new THREE.Vector2(-1,1); -THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.fog=null;this.center=new THREE.Vector3;this.collisions=this.overrideMaterial=null;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.add=function(b){this.supr.add.call(this,b);this.addChildRecurse(b)}; +THREE.Scene=function(){THREE.Object3D.call(this);this.matrixAutoUpdate=!1;this.fog=null;this.origin=new THREE.Vector3;this.collisions=this.overrideMaterial=null;this.objects=[];this.lights=[];this.__objectsAdded=[];this.__objectsRemoved=[]};THREE.Scene.prototype=new THREE.Object3D;THREE.Scene.prototype.constructor=THREE.Scene;THREE.Scene.prototype.supr=THREE.Object3D.prototype;THREE.Scene.prototype.add=function(b){this.supr.add.call(this,b);this.addChildRecurse(b)}; THREE.Scene.prototype.addChildRecurse=function(b){if(b instanceof THREE.Light)this.lights.indexOf(b)===-1&&this.lights.push(b);else if(!(b instanceof THREE.Camera||b instanceof THREE.Bone)&&this.objects.indexOf(b)===-1){this.objects.push(b);this.__objectsAdded.push(b);var c=this.__objectsRemoved.indexOf(b);c!==-1&&this.__objectsRemoved.splice(c,1)}for(c=0;c