Browse Source

WebGLRenderer2: Changed some multiplySelf and subSelf.

Mr.doob 12 năm trước cách đây
mục cha
commit
bc010e4d19

+ 4 - 4
src/renderers/WebGLRenderer2.js

@@ -1211,7 +1211,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
 
 		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 
-		_projScreenMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse );
+		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 		_frustum.setFromMatrix( _projScreenMatrix );
 
 		// update WebGL objects
@@ -2944,7 +2944,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
 
 	function setupMatrices ( object, camera ) {
 
-		object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld );
+		object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
 
 		object._normalMatrix.getInverse( object._modelViewMatrix );
 		object._normalMatrix.transpose();
@@ -3048,7 +3048,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
 				if ( ! light.visible ) continue;
 
 				_direction.copy( light.matrixWorld.getPosition() );
-				_direction.subSelf( light.target.matrixWorld.getPosition() );
+				_direction.sub( light.target.matrixWorld.getPosition() );
 				_direction.normalize();
 
 				// skip lights with undefined direction
@@ -3129,7 +3129,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
 				spotDistances[ spotLength ] = distance;
 
 				_direction.copy( position );
-				_direction.subSelf( light.target.matrixWorld.getPosition() );
+				_direction.sub( light.target.matrixWorld.getPosition() );
 				_direction.normalize();
 
 				spotDirections[ spotOffset ]     = _direction.x;

+ 2 - 3
src/renderers/webgl/objects/ParticleRenderer.js

@@ -55,14 +55,13 @@ THREE.WebGLRenderer2.ParticleRenderer.prototype.setBuffers = function( geometry,
 	i, il,
 	a, ca, cal, value,
 	customAttribute;
-	
+
 	var _projScreenMatrixPS = THREE.WebGLRenderer2.ParticleRenderer._m1,
 		_vector3 = THREE.WebGLRenderer2.ParticleRenderer._v1;
 
 	if ( object.sortParticles ) {
 
-		_projScreenMatrixPS.copy( projectionScreenMatrix );
-		_projScreenMatrixPS.multiplySelf( object.matrixWorld );
+		_projScreenMatrixPS.multiplyMatrices( projectionScreenMatrix, object.matrixWorld );
 
 		for ( v = 0; v < vl; v ++ ) {