Jelajahi Sumber

use get descendents instead of childrean

Trevor Baron 7 tahun lalu
induk
melakukan
c7fc3ff5fb

+ 1 - 1
dist/preview release/what's new.md

@@ -7,7 +7,7 @@
   - New GUI control: [Grid](http://doc.babylonjs.com/how_to/gui#grid) ([Deltakosh](https://github.com/deltakosh))
   - New GUI control: [InputPassword](https://doc.babylonjs.com/how_to/gui#inputpassword) ([theom](https://github.com/theom))
 - Gizmo Support ([TrevorDev](https://github.com/TrevorDev))
-  - Gizmo and GizmoManager classes used to manipulate meshes in a scene. Gizmo types include: position, rotation, scale and bounding box. [Doc](http://doc.babylonjs.com/how_to/gizmo) ([TrevorDev](https://github.com/TrevorDev))
+  - Gizmo and GizmoManager classes used to manipulate meshes in a scene. Gizmo types include: position, scale, rotation and bounding box. [Doc](http://doc.babylonjs.com/how_to/gizmo) ([TrevorDev](https://github.com/TrevorDev))
   - New behaviors: PointerDragBehavior, SixDofDragBehavior and MultiPointerScaleBehavior to enable smooth drag and drop/scaling with mouse or 6dof controller on a mesh. [Doc](http://doc.babylonjs.com/how_to/meshbehavior) ([TrevorDev](https://github.com/TrevorDev))
   - Added attachToBoxBehavior to attach UI to a bounding box ([TrevorDev](https://github.com/TrevorDev))
   - Gizmo manager's internal gizmos are now public ([TrevorDev](https://github.com/TrevorDev))

+ 4 - 4
src/Gizmos/babylon.boundingBoxGizmo.ts

@@ -272,11 +272,11 @@ module BABYLON {
                 })
         }
 
-        private _recurseComputeWorld(mesh: AbstractMesh) {
-            mesh.computeWorldMatrix(true);
+        private _recurseComputeWorld(node: Node) {
+            node.computeWorldMatrix(true);
             if(!this.ignoreChildren){
-                mesh.getChildMeshes().forEach((m) => {
-                    this._recurseComputeWorld(m);
+                node.getDescendants().forEach((n) => {
+                    this._recurseComputeWorld(n);
                 });
             }
         }