Explorar o código

Fix texture loading bug with lens flares

David Catuhe %!s(int64=6) %!d(string=hai) anos
pai
achega
65c0b7a46a
Modificáronse 2 ficheiros con 12 adicións e 0 borrados
  1. 8 0
      src/Bones/bone.ts
  2. 4 0
      src/LensFlares/lensFlareSystem.ts

+ 8 - 0
src/Bones/bone.ts

@@ -246,6 +246,14 @@ export class Bone extends Node {
 
     // Properties (matches AbstractMesh properties)
 
+    /**
+     * Gets the node used to drive the bone's transformation
+     * @returns a transform node or null 
+     */
+    public getTransformNode() {
+        return this._linkedTransformNode;
+    }
+
     /** Gets or sets current position (in local space) */
     public get position(): Vector3 {
         this._decompose();

+ 4 - 0
src/LensFlares/lensFlareSystem.ts

@@ -313,6 +313,10 @@ export class LensFlareSystem {
         for (var index = 0; index < this.lensFlares.length; index++) {
             var flare = this.lensFlares[index];
 
+            if (flare.texture && !flare.texture.isReady()) {
+                continue;
+            }
+
             engine.setAlphaMode(flare.alphaMode);
 
             var x = centerX - (distX * flare.position);