@luminocity/lemonate-engine 26.4.3 → 26.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,7 +95,7 @@ export declare class SceneGraph {
95
95
  * @param node
96
96
  * @return {boolean}
97
97
  */
98
- traverse(callback: SgItemTraverseFunction, node?: SgItem): boolean;
98
+ traverse(callback: SgItemTraverseFunction, node?: SgItem, depthFirst?: boolean): boolean;
99
99
  /**
100
100
  * Traverse all nodes of the scenegraph including linked scenegraph
101
101
  * @param callback
@@ -11390,7 +11390,7 @@ class Item extends EventEmitter {
11390
11390
  }
11391
11391
  }
11392
11392
 
11393
- var engine$1 = "26.4.3";
11393
+ var engine$1 = "26.4.4";
11394
11394
  var bullet = "3.26";
11395
11395
  var lua = "5.4.3";
11396
11396
  var packageVersionInfo = {
@@ -70552,7 +70552,7 @@ class SgItem extends SgResourceOwner {
70552
70552
  * this item's container to its parent directly. But in case where this item has a subNodeId, it is not directly
70553
70553
  * a child of its parent but to one of its subnodes. We need to check if this subnode exists and then add
70554
70554
  * ourselves to it. If that subnode does not exist, we will instead add to the parent directly again.
70555
- * This function needs to be called whenecer the parent updates its subnodes, because this would mean
70555
+ * This function needs to be called whenever the parent updates its subnodes, because this would mean
70556
70556
  * the subnode will suddenly appear/disappear and we need to update parenting again
70557
70557
  */
70558
70558
  updateParenting() {
@@ -73559,7 +73559,6 @@ class SgMesh extends SgPhysicsItem {
73559
73559
  this.mixer = undefined;
73560
73560
  this.animations = [];
73561
73561
  this.activeTweens = undefined;
73562
- this.setFieldValue("Animations", []);
73563
73562
  }
73564
73563
  isAnimated() {
73565
73564
  return Boolean(this.mixer);
@@ -88201,9 +88200,15 @@ class SceneGraph {
88201
88200
  * @param node
88202
88201
  * @return {boolean}
88203
88202
  */
88204
- traverse(callback, node) {
88203
+ traverse(callback, node, depthFirst = false) {
88205
88204
  node = node || this.root;
88206
88205
  if (node) {
88206
+ if (depthFirst) {
88207
+ for (const child of node.children) {
88208
+ if (!this.traverse(callback, child, true))
88209
+ return false;
88210
+ }
88211
+ }
88207
88212
  const result = callback(node);
88208
88213
  if (result === false)
88209
88214
  return false;
@@ -88212,13 +88217,15 @@ class SceneGraph {
88212
88217
  if (sceneItem) {
88213
88218
  const sceneGraph = sceneItem.getSceneGraph();
88214
88219
  if (sceneGraph)
88215
- if (!sceneGraph.traverse(callback))
88220
+ if (!sceneGraph.traverse(callback, undefined, depthFirst))
88216
88221
  return false;
88217
88222
  }
88218
88223
  }
88219
- for (const child of node.children) {
88220
- if (!this.traverse(callback, child))
88221
- return false;
88224
+ if (!depthFirst) {
88225
+ for (const child of node.children) {
88226
+ if (!this.traverse(callback, child, false))
88227
+ return false;
88228
+ }
88222
88229
  }
88223
88230
  }
88224
88231
  return true;
@@ -88562,7 +88569,7 @@ class SceneGraph {
88562
88569
  return false;
88563
88570
  }
88564
88571
  return true;
88565
- });
88572
+ }, undefined, true);
88566
88573
  return result;
88567
88574
  }
88568
88575
  findSelectedItems() {
package/dist/lemonate.js CHANGED
@@ -87367,7 +87367,7 @@ void main() {
87367
87367
  }
87368
87368
  }
87369
87369
 
87370
- var engine$1 = "26.4.3";
87370
+ var engine$1 = "26.4.4";
87371
87371
  var bullet = "3.26";
87372
87372
  var lua = "5.4.3";
87373
87373
  var packageVersionInfo = {
@@ -229190,7 +229190,7 @@ var<${access}> ${ name } : ${ structName };`;
229190
229190
  * this item's container to its parent directly. But in case where this item has a subNodeId, it is not directly
229191
229191
  * a child of its parent but to one of its subnodes. We need to check if this subnode exists and then add
229192
229192
  * ourselves to it. If that subnode does not exist, we will instead add to the parent directly again.
229193
- * This function needs to be called whenecer the parent updates its subnodes, because this would mean
229193
+ * This function needs to be called whenever the parent updates its subnodes, because this would mean
229194
229194
  * the subnode will suddenly appear/disappear and we need to update parenting again
229195
229195
  */
229196
229196
  updateParenting() {
@@ -232197,7 +232197,6 @@ var<${access}> ${ name } : ${ structName };`;
232197
232197
  this.mixer = undefined;
232198
232198
  this.animations = [];
232199
232199
  this.activeTweens = undefined;
232200
- this.setFieldValue("Animations", []);
232201
232200
  }
232202
232201
  isAnimated() {
232203
232202
  return Boolean(this.mixer);
@@ -246839,9 +246838,15 @@ var<${access}> ${ name } : ${ structName };`;
246839
246838
  * @param node
246840
246839
  * @return {boolean}
246841
246840
  */
246842
- traverse(callback, node) {
246841
+ traverse(callback, node, depthFirst = false) {
246843
246842
  node = node || this.root;
246844
246843
  if (node) {
246844
+ if (depthFirst) {
246845
+ for (const child of node.children) {
246846
+ if (!this.traverse(callback, child, true))
246847
+ return false;
246848
+ }
246849
+ }
246845
246850
  const result = callback(node);
246846
246851
  if (result === false)
246847
246852
  return false;
@@ -246850,13 +246855,15 @@ var<${access}> ${ name } : ${ structName };`;
246850
246855
  if (sceneItem) {
246851
246856
  const sceneGraph = sceneItem.getSceneGraph();
246852
246857
  if (sceneGraph)
246853
- if (!sceneGraph.traverse(callback))
246858
+ if (!sceneGraph.traverse(callback, undefined, depthFirst))
246854
246859
  return false;
246855
246860
  }
246856
246861
  }
246857
- for (const child of node.children) {
246858
- if (!this.traverse(callback, child))
246859
- return false;
246862
+ if (!depthFirst) {
246863
+ for (const child of node.children) {
246864
+ if (!this.traverse(callback, child, false))
246865
+ return false;
246866
+ }
246860
246867
  }
246861
246868
  }
246862
246869
  return true;
@@ -247200,7 +247207,7 @@ var<${access}> ${ name } : ${ structName };`;
247200
247207
  return false;
247201
247208
  }
247202
247209
  return true;
247203
- });
247210
+ }, undefined, true);
247204
247211
  return result;
247205
247212
  }
247206
247213
  findSelectedItems() {