Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneUtils: Add generator-based traversal methods. #28053

Merged
merged 7 commits into from
Apr 23, 2024

Conversation

HoloTheDrunk
Copy link
Contributor

@HoloTheDrunk HoloTheDrunk commented Apr 2, 2024

Fixed #28052

Description

The current traversal API is not convenient when implementing certain patterns, while generators are far more flexible since they don't incur a callback scope.
Adding an optional condition callback allows for slightly more optimized traversal.

Copy link

github-actions bot commented Apr 2, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
671.1 kB (166.4 kB) 671.6 kB (166.5 kB) +459 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
451 kB (109 kB) 451.5 kB (109 kB) +459 B

@HoloTheDrunk HoloTheDrunk marked this pull request as draft April 2, 2024 13:42
@HoloTheDrunk HoloTheDrunk marked this pull request as ready for review April 2, 2024 14:05
src/core/Object3D.js Outdated Show resolved Hide resolved
examples/jsm/utils/SceneUtils.js Fixed Show resolved Hide resolved
examples/jsm/utils/SceneUtils.js Fixed Show fixed Hide fixed
examples/jsm/utils/SceneUtils.js Fixed Show fixed Hide fixed
@Mugen87 Mugen87 added this to the r164 milestone Apr 23, 2024
@Mugen87 Mugen87 merged commit 0de958e into mrdoob:dev Apr 23, 2024
9 of 10 checks passed
@Mugen87 Mugen87 changed the title Object3D: add generator-based traversal methods SceneUtils: Add generator-based traversal methods. Apr 23, 2024
@HoloTheDrunk HoloTheDrunk deleted the traversal_generator branch April 23, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add generator-based Object3D traversal methods
3 participants