lythreeframe 1.2.38 → 1.2.39

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.
@@ -2443,6 +2443,23 @@ class Actor extends BaseObject {
2443
2443
  return ret;
2444
2444
  }
2445
2445
  }
2446
+ getChildActorById(id, bRecursive = true) {
2447
+ const directChildren = this.childActors;
2448
+ for (const child of directChildren) {
2449
+ if (child.uuid === id) {
2450
+ return child;
2451
+ }
2452
+ }
2453
+ if (bRecursive) {
2454
+ for (const child of directChildren) {
2455
+ const foundInChild = child.getChildActorById(id, true);
2456
+ if (foundInChild) {
2457
+ return foundInChild;
2458
+ }
2459
+ }
2460
+ }
2461
+ return null;
2462
+ }
2446
2463
  getBoundsTopCenterPosition(bInWorldSpace = true) {
2447
2464
  let ret = new webgpu.Vector3();
2448
2465
  let bounds = this.rootComponent.getBounds();
@@ -2441,6 +2441,23 @@ class Actor extends BaseObject {
2441
2441
  return ret;
2442
2442
  }
2443
2443
  }
2444
+ getChildActorById(id, bRecursive = true) {
2445
+ const directChildren = this.childActors;
2446
+ for (const child of directChildren) {
2447
+ if (child.uuid === id) {
2448
+ return child;
2449
+ }
2450
+ }
2451
+ if (bRecursive) {
2452
+ for (const child of directChildren) {
2453
+ const foundInChild = child.getChildActorById(id, true);
2454
+ if (foundInChild) {
2455
+ return foundInChild;
2456
+ }
2457
+ }
2458
+ }
2459
+ return null;
2460
+ }
2444
2461
  getBoundsTopCenterPosition(bInWorldSpace = true) {
2445
2462
  let ret = new Vector3();
2446
2463
  let bounds = this.rootComponent.getBounds();
@@ -27,6 +27,7 @@ export declare class Actor extends BaseObject {
27
27
  constructor(app: ThreeJsApp, uuid?: string);
28
28
  protected constructRootComponent(): SceneComponent;
29
29
  getBoundsCenterPosition(bInWorldSpace?: boolean): Vector3;
30
+ getChildActorById(id: string, bRecursive?: boolean): Actor | null;
30
31
  getBoundsTopCenterPosition(bInWorldSpace?: boolean): Vector3;
31
32
  getBoundsBottomCenterPosition(bInWorldSpace?: boolean): Vector3;
32
33
  getBounds(): import("three").Box3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",