Browse Source

Removed unused Matrix4.matrixRotationWorld. See #3220.

Mr.doob 12 years ago
parent
commit
2b63e4f8b2

+ 0 - 4
build/three.js

@@ -6018,8 +6018,6 @@ THREE.EventDispatcher.prototype = {
 			var a, b, c, d;
 			var precision = raycaster.precision;
 
-			object.matrixRotationWorld.extractRotation( object.matrixWorld );
-
 			inverseMatrix.getInverse( object.matrixWorld );
 
 			localRay.copy( raycaster.ray ).applyMatrix4( inverseMatrix );
@@ -6196,7 +6194,6 @@ THREE.Object3D = function () {
 
 	this.matrix = new THREE.Matrix4();
 	this.matrixWorld = new THREE.Matrix4();
-	this.matrixRotationWorld = new THREE.Matrix4();
 
 	this.matrixAutoUpdate = true;
 	this.matrixWorldNeedsUpdate = true;
@@ -6632,7 +6629,6 @@ THREE.Object3D.prototype = {
 
 		object.matrix.copy( this.matrix );
 		object.matrixWorld.copy( this.matrixWorld );
-		object.matrixRotationWorld.copy( this.matrixRotationWorld );
 
 		object.matrixAutoUpdate = this.matrixAutoUpdate;
 		object.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate;

+ 7 - 7
build/three.min.js

@@ -125,11 +125,11 @@ THREE.extend(THREE.Clock.prototype,{start:function(){this.oldTime=this.startTime
 a=0.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}});THREE.EventDispatcher=function(){};
 THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners,d=c[a].indexOf(b);-1!==d&&c[a].splice(d,1)}},dispatchEvent:function(a){if(void 0!==
 this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}};(function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c);0<this.ray.direction.lengthSq()&&this.ray.direction.normalize();this.near=d||0;this.far=e||Infinity};var b=new a.Sphere,c=new a.Ray,d=new a.Plane,e=new a.Vector3,f=new a.Vector3,g=new a.Matrix4,h=function(a,b){return a.distance-b.distance},i=function(h,j,p){if(h instanceof a.Particle){f.getPositionFromMatrix(h.matrixWorld);var r=j.ray.distanceToPoint(f);if(r>h.scale.x)return p;p.push({distance:r,point:h.position,face:null,object:h})}else if(h instanceof
-a.LOD)f.getPositionFromMatrix(h.matrixWorld),r=j.ray.origin.distanceTo(f),i(h.getObjectForDistance(r),j,p);else if(h instanceof a.Mesh){f.getPositionFromMatrix(h.matrixWorld);b.set(f,h.geometry.boundingSphere.radius*h.matrixWorld.getMaxScaleOnAxis());if(!j.ray.isIntersectionSphere(b))return p;var r=h.geometry,s=r.vertices,n=h.material instanceof a.MeshFaceMaterial,q=!0===n?h.material.materials:null,y=h.material.side,u,x,t,D=j.precision;h.matrixRotationWorld.extractRotation(h.matrixWorld);g.getInverse(h.matrixWorld);
-c.copy(j.ray).applyMatrix4(g);for(var J=0,F=r.faces.length;J<F;J++){var z=r.faces[J],y=!0===n?q[z.materialIndex]:h.material;if(void 0!==y){d.setFromNormalAndCoplanarPoint(z.normal,s[z.a]);var H=c.distanceToPlane(d);if(!(Math.abs(H)<D)&&!(0>H)){y=y.side;if(y!==a.DoubleSide&&(u=c.direction.dot(d.normal),!(y===a.FrontSide?0>u:0<u)))continue;if(!(H<j.near||H>j.far)){e=c.at(H,e);if(z instanceof a.Face3){if(y=s[z.a],u=s[z.b],x=s[z.c],!a.Triangle.containsPoint(e,y,u,x))continue}else if(z instanceof a.Face4){if(y=
-s[z.a],u=s[z.b],x=s[z.c],t=s[z.d],!a.Triangle.containsPoint(e,y,u,t)&&!a.Triangle.containsPoint(e,u,x,t))continue}else throw Error("face type not supported");p.push({distance:H,point:j.ray.at(H),face:z,faceIndex:J,object:h})}}}}}},j=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)i(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b);0<this.ray.direction.length()&&this.ray.direction.normalize()};a.Raycaster.prototype.intersectObject=
-function(a,b){var c=[];!0===b&&j(a,this,c);i(a,this,c);c.sort(h);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)i(a[d],this,c),!0===b&&j(a[d],this,c);c.sort(h);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder=THREE.Object3D.defaultEulerOrder;this.scale=new THREE.Vector3(1,1,1);this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=
-new THREE.Quaternion;this.useQuaternion=!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
+a.LOD)f.getPositionFromMatrix(h.matrixWorld),r=j.ray.origin.distanceTo(f),i(h.getObjectForDistance(r),j,p);else if(h instanceof a.Mesh){f.getPositionFromMatrix(h.matrixWorld);b.set(f,h.geometry.boundingSphere.radius*h.matrixWorld.getMaxScaleOnAxis());if(!j.ray.isIntersectionSphere(b))return p;var r=h.geometry,s=r.vertices,n=h.material instanceof a.MeshFaceMaterial,q=!0===n?h.material.materials:null,y=h.material.side,u,x,t,D=j.precision;g.getInverse(h.matrixWorld);c.copy(j.ray).applyMatrix4(g);for(var J=
+0,F=r.faces.length;J<F;J++){var z=r.faces[J],y=!0===n?q[z.materialIndex]:h.material;if(void 0!==y){d.setFromNormalAndCoplanarPoint(z.normal,s[z.a]);var H=c.distanceToPlane(d);if(!(Math.abs(H)<D)&&!(0>H)){y=y.side;if(y!==a.DoubleSide&&(u=c.direction.dot(d.normal),!(y===a.FrontSide?0>u:0<u)))continue;if(!(H<j.near||H>j.far)){e=c.at(H,e);if(z instanceof a.Face3){if(y=s[z.a],u=s[z.b],x=s[z.c],!a.Triangle.containsPoint(e,y,u,x))continue}else if(z instanceof a.Face4){if(y=s[z.a],u=s[z.b],x=s[z.c],t=s[z.d],
+!a.Triangle.containsPoint(e,y,u,t)&&!a.Triangle.containsPoint(e,u,x,t))continue}else throw Error("face type not supported");p.push({distance:H,point:j.ray.at(H),face:z,faceIndex:J,object:h})}}}}}},j=function(a,b,c){for(var a=a.getDescendants(),d=0,e=a.length;d<e;d++)i(a[d],b,c)};a.Raycaster.prototype.precision=1E-4;a.Raycaster.prototype.set=function(a,b){this.ray.set(a,b);0<this.ray.direction.length()&&this.ray.direction.normalize()};a.Raycaster.prototype.intersectObject=function(a,b){var c=[];!0===
+b&&j(a,this,c);i(a,this,c);c.sort(h);return c};a.Raycaster.prototype.intersectObjects=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)i(a[d],this,c),!0===b&&j(a[d],this,c);c.sort(h);return c}})(THREE);THREE.Object3D=function(){this.id=THREE.Object3DIdCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder=THREE.Object3D.defaultEulerOrder;this.scale=new THREE.Vector3(1,1,1);this.renderDepth=null;this.rotationAutoUpdate=!0;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate=!0;this.quaternion=new THREE.Quaternion;this.useQuaternion=
+!1;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.userData={}};
 THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(){var a=new THREE.Matrix4;return function(b){this.matrix.multiplyMatrices(b,this.matrix);this.position.getPositionFromMatrix(this.matrix);this.scale.getScaleFromMatrix(this.matrix);a.extractRotation(this.matrix);!0===this.useQuaternion?this.quaternion.setFromRotationMatrix(a):this.rotation.setEulerFromRotationMatrix(a,this.eulerOrder)}}(),rotateOnAxis:function(){var a=new THREE.Quaternion,b=new THREE.Quaternion;return function(c,
 d){a.setFromAxisAngle(c,d);!0===this.useQuaternion?this.quaternion.multiply(a):(b.setFromEuler(this.rotation,this.eulerOrder),b.multiply(a),this.rotation.setEulerFromQuaternion(b,this.eulerOrder));return this}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){a.copy(b);!0===this.useQuaternion?a.applyQuaternion(this.quaternion):a.applyEuler(this.rotation,this.eulerOrder);this.position.add(a.multiplyScalar(c));return this}}(),translate:function(a,b){console.warn("DEPRECATED: Object3D's .translate() has been removed. Use .translateOnAxis( axis, distance ) instead. Note args have been changed.");
 return this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),
@@ -138,8 +138,8 @@ b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b=this.child
 getObjectByName:function(a,b){for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c];if(e.name===a||!0===b&&(e=e.getObjectByName(a,b),void 0!==e))return e}},getChildByName:function(a,b){console.warn("DEPRECATED: Object3D's .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a,b)},getDescendants:function(a){void 0===a&&(a=[]);Array.prototype.push.apply(a,this.children);for(var b=0,c=this.children.length;b<c;b++)this.children[b].getDescendants(a);return a},
 updateMatrix:function(){this.matrix.setPosition(this.position);!1===this.useQuaternion?this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder):this.matrix.setRotationFromQuaternion(this.quaternion);(1!==this.scale.x||1!==this.scale.y||1!==this.scale.z)&&this.matrix.scale(this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):
 this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},clone:function(a){void 0===a&&(a=new THREE.Object3D);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.rotation instanceof THREE.Vector3&&a.rotation.copy(this.rotation);a.eulerOrder=this.eulerOrder;a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;
-a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixRotationWorld.copy(this.matrixRotationWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);a.useQuaternion=this.useQuaternion;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));for(var b=0;b<this.children.length;b++)a.add(this.children[b].clone());
-return a}};THREE.Object3D.defaultEulerOrder="XYZ";THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(f===h){var a=new THREE.RenderableObject;g.push(a);h++;f++;return a}return g[f++]}function b(){if(j===l){var a=new THREE.RenderableVertex;m.push(a);l++;j++;return a}return m[j++]}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<
+a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate;a.quaternion.copy(this.quaternion);a.useQuaternion=this.useQuaternion;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));for(var b=0;b<this.children.length;b++)a.add(this.children[b].clone());return a}};
+THREE.Object3D.defaultEulerOrder="XYZ";THREE.Object3DIdCount=0;THREE.Projector=function(){function a(){if(f===h){var a=new THREE.RenderableObject;g.push(a);h++;f++;return a}return g[f++]}function b(){if(j===l){var a=new THREE.RenderableVertex;m.push(a);l++;j++;return a}return m[j++]}function c(a,b){return b.z-a.z}function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if(0<=e&&0<=f&&0<=g&&0<=h)return!0;if(0>e&&0>f||0>g&&0>h)return!1;0>e?c=Math.max(c,e/(e-f)):0>f&&(d=Math.min(d,e/(e-f)));0>g?c=Math.max(c,g/(g-h)):0>h&&(d=Math.min(d,g/(g-h)));if(d<
 c)return!1;a.lerp(b,c);b.lerp(a,1-d);return!0}var e,f,g=[],h=0,i,j,m=[],l=0,p,r,s=[],n=0,q,y=[],u=0,x,t,D=[],J=0,F,z,H=[],L=0,I={objects:[],sprites:[],lights:[],elements:[]},N=new THREE.Vector3,A=new THREE.Vector4,U=new THREE.Box3(new THREE.Vector3(-1,-1,-1),new THREE.Vector3(1,1,1)),G=new THREE.Box3,K=Array(3),M=Array(4),T=new THREE.Matrix4,$=new THREE.Matrix4,wa,fb=new THREE.Matrix4,B=new THREE.Matrix3,ca=new THREE.Matrix3,qa=new THREE.Vector3,ga=new THREE.Frustum,ja=new THREE.Vector4,E=new THREE.Vector4;
 this.projectVector=function(a,b){b.matrixWorldInverse.getInverse(b.matrixWorld);$.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);return a.applyProjection($)};this.unprojectVector=function(a,b){b.projectionMatrixInverse.getInverse(b.projectionMatrix);$.multiplyMatrices(b.matrixWorld,b.projectionMatrixInverse);return a.applyProjection($)};this.pickingRay=function(a,b){a.z=-1;var c=new THREE.Vector3(a.x,a.y,1);this.unprojectVector(a,b);this.unprojectVector(c,b);c.sub(a).normalize();return new THREE.Raycaster(a,
 c)};this.projectScene=function(g,h,l,Xa){var Ba=!1,ma,fa,X,V,Y,ia,ha,na,Ka,Ya,pa,Na,Qa;z=t=q=r=0;I.elements.length=0;g.updateMatrixWorld();void 0===h.parent&&h.updateMatrixWorld();T.copy(h.matrixWorldInverse.getInverse(h.matrixWorld));$.multiplyMatrices(h.projectionMatrix,T);ca.getInverse(T);ca.transpose();ga.setFromMatrix($);f=0;I.objects.length=0;I.sprites.length=0;I.lights.length=0;var Va=function(b){for(var c=0,d=b.children.length;c<d;c++){var f=b.children[c];if(!1!==f.visible){if(f instanceof

+ 0 - 5
docs/api/core/Object3D.html

@@ -69,11 +69,6 @@
 		Local transform.
 		</div>
 
-		<h3>.[page:Matrix4 matrixRotationWorld]</h3>
-		<div>
-		Global rotation.
-		</div>
-
 		<h3>.[page:Quaternion quaternion]</h3>
 		<div>
 		Object's local rotation as [page:Quaternion Quaternion]. Only used when useQuaternion is set to true.

+ 10 - 6
examples/canvas_interactive_voxelpainter.html

@@ -27,6 +27,7 @@
 			var mouse2D, mouse3D, raycaster, theta = 45,
 			isShiftDown = false, isCtrlDown = false,
 			target = new THREE.Vector3( 0, 200, 0 );
+			var normalMatrix = new THREE.Matrix3();
 			var ROLLOVERED;
 
 			init();
@@ -160,22 +161,25 @@
 
 				if ( intersects.length > 0 ) {
 
-					var interect = intersects[ 0 ];
+					var intersect = intersects[ 0 ];
 
 					if ( isCtrlDown ) {
 
-						if ( interect.object != plane ) {
+						if ( intersect.object != plane ) {
 
-							scene.remove( interect.object );
+							scene.remove( intersect.object );
 
 						}
 
 					} else {
 
-						var normal = interect.face.normal.clone();
-						normal.applyMatrix4( interect.object.matrixRotationWorld );
+						normalMatrix.getInverse( intersect.object.matrixWorld );
+						normalMatrix.transpose();
 
-						var position = new THREE.Vector3().addVectors( interect.point, normal );
+						var normal = intersect.face.normal.clone();
+						normal.applyMatrix3( normalMatrix ).normalize();
+
+						var position = new THREE.Vector3().addVectors( intersect.point, normal );
 
 						var geometry = new THREE.CubeGeometry( 50, 50, 50 );
 

+ 6 - 2
examples/webgl_interactive_voxelpainter.html

@@ -33,7 +33,8 @@
 			rollOveredFace, isShiftDown = false,
 			theta = 45 * 0.5, isCtrlDown = false;
 
-			var rollOverMesh, rollOverMaterial, voxelPosition = new THREE.Vector3(), tmpVec = new THREE.Vector3();
+			var rollOverMesh, rollOverMaterial;
+			var voxelPosition = new THREE.Vector3(), tmpVec = new THREE.Vector3(), normalMatrix = new THREE.Matrix3();
 			var cubeGeo, cubeMaterial;
 			var i, intersector;
 
@@ -142,8 +143,11 @@
 
 			function setVoxelPosition( intersector ) {
 
+				normalMatrix.getInverse( intersector.object.matrixWorld );
+				normalMatrix.transpose();
+
 				tmpVec.copy( intersector.face.normal );
-				tmpVec.applyMatrix4( intersector.object.matrixRotationWorld );
+				tmpVec.applyMatrix3( normalMatrix ).normalize();
 
 				voxelPosition.addVectors( intersector.point, tmpVec );
 

+ 36 - 29
examples/webgl_ribbons.html

@@ -122,49 +122,56 @@
 				nribbons = xgrid * ygrid;
 
 				c = 0;
-				for ( i = 0; i < xgrid; i ++ )
-				for ( j = 0; j < ygrid; j ++ ) {
 
-					var material = new THREE.MeshBasicMaterial( { color: 0xffffff, vertexColors: true, side: THREE.DoubleSide } );
+				var rotationMatrix = new THREE.Matrix4();
 
-					ribbon = new THREE.Ribbon( i % 2 ? geometry : geometry2, material );
-					ribbon.rotation.x = 0;
-					ribbon.rotation.y = Math.PI / 2;
-					ribbon.rotation.z = Math.PI;
+				for ( i = 0; i < xgrid; i ++ ) {
 
-					x = 40 * ( i - xgrid/2 );
-					y = 40 * ( j - ygrid/2 );
-					z = 0;
+					for ( j = 0; j < ygrid; j ++ ) {
 
-					ribbon.position.set( x, y, z );
+						var material = new THREE.MeshBasicMaterial( { color: 0xffffff, vertexColors: true, side: THREE.DoubleSide } );
 
-					ribbon.matrixAutoUpdate = false;
+						ribbon = new THREE.Ribbon( i % 2 ? geometry : geometry2, material );
+						ribbon.rotation.x = 0;
+						ribbon.rotation.y = Math.PI / 2;
+						ribbon.rotation.z = Math.PI;
 
-					// manually create local matrix
+						x = 40 * ( i - xgrid/2 );
+						y = 40 * ( j - ygrid/2 );
+						z = 0;
 
-					ribbon.matrix.setPosition( ribbon.position );
-					ribbon.matrixRotationWorld.setRotationFromEuler( ribbon.rotation );
+						ribbon.position.set( x, y, z );
 
-					ribbon.matrix.elements[ 0 ] = ribbon.matrixRotationWorld.elements[ 0 ];
-					ribbon.matrix.elements[ 4 ] = ribbon.matrixRotationWorld.elements[ 4 ];
-					ribbon.matrix.elements[ 8 ] = ribbon.matrixRotationWorld.elements[ 8 ];
+						ribbon.matrixAutoUpdate = false;
 
-					ribbon.matrix.elements[ 1 ] = ribbon.matrixRotationWorld.elements[ 1 ];
-					ribbon.matrix.elements[ 5 ] = ribbon.matrixRotationWorld.elements[ 5 ];
-					ribbon.matrix.elements[ 9 ] = ribbon.matrixRotationWorld.elements[ 9 ];
+						// manually create local matrix
 
-					ribbon.matrix.elements[ 2 ] = ribbon.matrixRotationWorld.elements[ 2 ];
-					ribbon.matrix.elements[ 6 ] = ribbon.matrixRotationWorld.elements[ 6 ];
-					ribbon.matrix.elements[ 10 ] = ribbon.matrixRotationWorld.elements[ 10 ];
+						ribbon.matrix.setPosition( ribbon.position );
 
-					ribbon.matrix.multiply( tmpRot );
+						rotationMatrix.setRotationFromEuler( ribbon.rotation );
 
-					ribbon.matrix.scale( ribbon.scale );
+						ribbon.matrix.elements[ 0 ] = rotationMatrix.elements[ 0 ];
+						ribbon.matrix.elements[ 4 ] = rotationMatrix.elements[ 4 ];
+						ribbon.matrix.elements[ 8 ] = rotationMatrix.elements[ 8 ];
 
-					ribbons.push( ribbon );
-					scene.add( ribbon );
+						ribbon.matrix.elements[ 1 ] = rotationMatrix.elements[ 1 ];
+						ribbon.matrix.elements[ 5 ] = rotationMatrix.elements[ 5 ];
+						ribbon.matrix.elements[ 9 ] = rotationMatrix.elements[ 9 ];
 
-					c ++;
+						ribbon.matrix.elements[ 2 ] = rotationMatrix.elements[ 2 ];
+						ribbon.matrix.elements[ 6 ] = rotationMatrix.elements[ 6 ];
+						ribbon.matrix.elements[ 10 ] = rotationMatrix.elements[ 10 ];
+
+						ribbon.matrix.multiply( tmpRot );
+
+						ribbon.matrix.scale( ribbon.scale );
+
+						ribbons.push( ribbon );
+						scene.add( ribbon );
+
+						c ++;
+
+					}
 
 				}
 

+ 0 - 2
src/core/Object3D.js

@@ -27,7 +27,6 @@ THREE.Object3D = function () {
 
 	this.matrix = new THREE.Matrix4();
 	this.matrixWorld = new THREE.Matrix4();
-	this.matrixRotationWorld = new THREE.Matrix4();
 
 	this.matrixAutoUpdate = true;
 	this.matrixWorldNeedsUpdate = true;
@@ -463,7 +462,6 @@ THREE.Object3D.prototype = {
 
 		object.matrix.copy( this.matrix );
 		object.matrixWorld.copy( this.matrixWorld );
-		object.matrixRotationWorld.copy( this.matrixRotationWorld );
 
 		object.matrixAutoUpdate = this.matrixAutoUpdate;
 		object.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate;

+ 0 - 2
src/core/Raycaster.js

@@ -91,8 +91,6 @@
 			var a, b, c, d;
 			var precision = raycaster.precision;
 
-			object.matrixRotationWorld.extractRotation( object.matrixWorld );
-
 			inverseMatrix.getInverse( object.matrixWorld );
 
 			localRay.copy( raycaster.ray ).applyMatrix4( inverseMatrix );