Bläddra i källkod

Fix a bug on intersection Enter/Exit triggers

The action is not launched if a mesh has only a trigger OnIntersectionExitTrigger (and no OnIntersectionEnterTrigger), as shown in the following example : http://www.babylonjs-playground.com/#1UKEF (check line 130).
Temechon 10 år sedan
förälder
incheckning
d41e44aa96
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      Babylon/babylon.scene.ts

+ 4 - 1
Babylon/babylon.scene.ts

@@ -1113,6 +1113,9 @@
                             if (indexOfOther > -1) {
                                 sourceMesh._intersectionsInProgress.splice(indexOfOther, 1);
                             }
+                        } else if (areIntersecting && currentIntersectionInProgress === -1 && action.trigger === ActionManager.OnIntersectionExitTrigger) {
+
+                            sourceMesh._intersectionsInProgress.push(otherMesh);
                         }
                     }
                 }
@@ -1665,4 +1668,4 @@
             return this._getByTags(this.materials, tagsQuery).concat(this._getByTags(this.multiMaterials, tagsQuery));
         }
     }
-} 
+}