Jelajahi Sumber

use MeshBatch.worldPosition

Nicolas Cannasse 4 tahun lalu
induk
melakukan
657d99d262
1 mengubah file dengan 6 tambahan dan 5 penghapusan
  1. 6 5
      hrt/prefab/l3d/MeshSpray.hx

+ 6 - 5
hrt/prefab/l3d/MeshSpray.hx

@@ -45,9 +45,11 @@ class MeshSpray extends Object3D {
 			if( !c.enabled || c.type != "model" )
 				continue;
 			var batch = mspray.batchesMap.get(c.source);
-			batch.setTransform(c.to(Object3D).getTransform());
+			batch.worldPosition = c.to(Object3D).getTransform();
 			batch.emitInstance();
 		}
+		for( b in mspray.batches )
+			b.worldPosition = null;
 		return ctx;
 	}
 
@@ -172,13 +174,12 @@ class MeshSprayObject extends h3d.scene.Object {
 				batches.push(batch);
 				blookup.set(m.primitive, batch);
 			}
-			@:privateAccess {
-				batch.absPos.load(c.absPos);
-				batch.posChanged = false;
-			}
+			batch.worldPosition = c.absPos;
 			batch.emitInstance();
 			c.culled = true;
 		}
+		for( b in batches )
+			b.worldPosition = null;
 	}
 
 }