Просмотр исходного кода

Merge pull request #5040 from Bolloxim/fix-node-parent-cache

hasNewParent(true) which drastically improves performance.  Definitely needs review! :)
David Catuhe 7 лет назад
Родитель
Сommit
454b3af1d9
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/babylon.node.ts

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

@@ -115,6 +115,7 @@
 - BoundingBoxGizmo scalePivot field that can be used to always scale objects from the bottom ([TrevorDev](https://github.com/TrevorDev))
 - BoundingBoxGizmo scalePivot field that can be used to always scale objects from the bottom ([TrevorDev](https://github.com/TrevorDev))
 - Improved _isSyncronized performance and reduced GC in TransformNode.computeWorldMatrix by directly reading property. ([Bolloxim](https://github.com/Bolloxim))
 - Improved _isSyncronized performance and reduced GC in TransformNode.computeWorldMatrix by directly reading property. ([Bolloxim](https://github.com/Bolloxim))
 - Added supports for reflectionMatrix in Skybox Mode Cube Texture allowing offsetting the world center or rotating the matrix ([sebavan](http://www.github.com/sebavan))
 - Added supports for reflectionMatrix in Skybox Mode Cube Texture allowing offsetting the world center or rotating the matrix ([sebavan](http://www.github.com/sebavan))
+- Improved performance of cached nodes but ensuring parent always updates cache. This removes failed isSynchronized test that meant computeWorldMatrix would always have to rebuild. On large scenes this could double framerate. ([Bolloxim](https://github.com/Bolloxim))
 
 
 ### glTF Loader
 ### glTF Loader
 
 

+ 1 - 1
src/babylon.node.ts

@@ -351,7 +351,7 @@
 
 
         /** @hidden */
         /** @hidden */
         public isSynchronized(updateCache?: boolean): boolean {
         public isSynchronized(updateCache?: boolean): boolean {
-            var check = this.hasNewParent();
+            var check = this.hasNewParent(true);
 
 
             check = check || !this.isSynchronizedWithParent();
             check = check || !this.isSynchronizedWithParent();