Nicolas Cannasse 4 år sedan
förälder
incheckning
76244db84b
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      hrt/prefab/l3d/MeshSpray.hx

+ 2 - 1
hrt/prefab/l3d/MeshSpray.hx

@@ -852,6 +852,7 @@ class MeshSpray extends Object3D {
 
 
 	override function makeInstance( ctx : Context ) {
 	override function makeInstance( ctx : Context ) {
 		ctx = super.makeInstance(ctx);
 		ctx = super.makeInstance(ctx);
+		var batches = new Map();
 		for( c in children ) {
 		for( c in children ) {
 			if( c.type != "model" )
 			if( c.type != "model" )
 				continue;
 				continue;
@@ -861,7 +862,7 @@ class MeshSpray extends Object3D {
 				batch = new h3d.scene.MeshBatch(cast(obj.primitive,h3d.prim.MeshPrimitive), obj.material, ctx.local3d);
 				batch = new h3d.scene.MeshBatch(cast(obj.primitive,h3d.prim.MeshPrimitive), obj.material, ctx.local3d);
 				batches.set(c.source, batch);
 				batches.set(c.source, batch);
 			}
 			}
-			batch.setTransform(m.getTransform());
+			batch.setTransform(c.to(Object3D).getTransform());
 			batch.emitInstance();
 			batch.emitInstance();
 		}
 		}
 		return ctx;
 		return ctx;