瀏覽代碼

Fix bug in DynamicFloatArray.sort()

nockawa 9 年之前
父節點
當前提交
8aa34ac2c6
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/Tools/babylon.dynamicFloatArray.ts

+ 4 - 1
src/Tools/babylon.dynamicFloatArray.ts

@@ -259,7 +259,10 @@
                 let newCount = Math.min(this.totalElementCount, count * 2);
 
                 this._sortTable = new Array<SortInfo>(newCount);
-                this._sortedTable = new Array<SortInfo>(newCount);
+            }
+
+            if (!this._sortTable || this._sortTable.length !== count) {
+                this._sortedTable = new Array<SortInfo>(count);
             }
 
             // Because, you know...