Browse Source

BatchedMesh: Change a flat zero matrix to a zero scale matrix (#27043)

Garrett Johnson 1 year ago
parent
commit
5d04c8e092
1 changed files with 4 additions and 4 deletions
  1. 4 4
      examples/jsm/objects/BatchedMesh.js

+ 4 - 4
examples/jsm/objects/BatchedMesh.js

@@ -10,11 +10,11 @@ import {
 } from 'three';
 } from 'three';
 
 
 const _identityMatrix = new Matrix4();
 const _identityMatrix = new Matrix4();
-const _zeroMatrix = new Matrix4().set(
+const _zeroScaleMatrix = new Matrix4().set(
 	0, 0, 0, 0,
 	0, 0, 0, 0,
 	0, 0, 0, 0,
 	0, 0, 0, 0,
 	0, 0, 0, 0,
 	0, 0, 0, 0,
-	0, 0, 0, 0
+	0, 0, 0, 1,
 );
 );
 
 
 // Custom shaders
 // Custom shaders
@@ -323,7 +323,7 @@ class BatchedMesh extends Mesh {
 		}
 		}
 
 
 		this._alives[ geometryId ] = false;
 		this._alives[ geometryId ] = false;
-		_zeroMatrix.toArray( this._matricesArray, geometryId * 16 );
+		_zeroScaleMatrix.toArray( this._matricesArray, geometryId * 16 );
 		this._matricesTexture.needsUpdate = true;
 		this._matricesTexture.needsUpdate = true;
 
 
 		// User needs to call optimize() to pack the data.
 		// User needs to call optimize() to pack the data.
@@ -396,7 +396,7 @@ class BatchedMesh extends Mesh {
 
 
 		} else {
 		} else {
 
 
-			_zeroMatrix.toArray( this._matricesArray, geometryId * 16 );
+			_zeroScaleMatrix.toArray( this._matricesArray, geometryId * 16 );
 
 
 		}
 		}