Sfoglia il codice sorgente

Update instancedMesh.ts

Now the InstancedMesh is not animating. To do this, at least you need to add information about the animation. Unfortunately, my knowledge of the engine is superficial. In my case, this code helped me.
imcasper 5 anni fa
parent
commit
1875bf3ae5
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      src/Meshes/instancedMesh.ts

+ 8 - 1
src/Meshes/instancedMesh.ts

@@ -52,7 +52,14 @@ export class InstancedMesh extends AbstractMesh {
         if (source.rotationQuaternion) {
         if (source.rotationQuaternion) {
             this.rotationQuaternion = source.rotationQuaternion.clone();
             this.rotationQuaternion = source.rotationQuaternion.clone();
         }
         }
-
+        
+        this.animations = source.animations;
+        for (var range of source.getAnimationRanges()) {
+            if (range != null) {
+                this.createAnimationRange(range.name, range.from, range.to);
+            }
+        }
+        
         this.infiniteDistance = source.infiniteDistance;
         this.infiniteDistance = source.infiniteDistance;
 
 
         this.setPivotMatrix(source.getPivotMatrix());
         this.setPivotMatrix(source.getPivotMatrix());