INNER CODE UNIT · JavaScript

wantRealize

MageStudio/Mage · src/physics/index.js:706

        const wantRealize = el => {
            if (el && el.isPhysicsEnabled && el.isPhysicsEnabled()) {
                realizeRoots.set(el.uuid(), el);
            }
        };

        // Independent bodies that travelled inside the moved subtree are stale.
        this.realizedRootsInSubtree(element).forEach(el => disposeUuids.add(el.uuid()));

        // The root of the position element left loses element's colliders.
        const oldRoot = oldParent ? this.topmostPhysicsRoot(oldParent) : null;
        if (oldRoot) {
            disposeUuids.add(oldRoot.uuid());
            wantRealize(oldRoot);
        }

        // The root element landed under (inclusive of element) gains them; with no
        // physics umbrella, each physics root in the moved subtree stands alone.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…