lingo3d
Version:
Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor
30 lines • 1.18 kB
JavaScript
import { jointSet } from "../../../collections/jointSet";
import { addMultipleSelectionTargets } from "../../../states/useMultipleSelectionTargets";
const findAllJointed = (target, jointedSet = new Set(), jointsCopy = new Set(jointSet)) => {
jointedSet.add(target);
for (const joint of jointsCopy)
if (joint.$fromManager === target) {
jointsCopy.delete(joint);
addMultipleSelectionTargets(joint);
if (joint.$toManager) {
jointedSet.add(joint.$toManager);
findAllJointed(joint.$toManager, jointedSet, jointsCopy);
}
}
else if (joint.$toManager === target) {
jointsCopy.delete(joint);
addMultipleSelectionTargets(joint);
if (joint.$fromManager) {
jointedSet.add(joint.$fromManager);
findAllJointed(joint.$fromManager, jointedSet, jointsCopy);
}
}
return jointedSet;
};
export default (target) => {
if (!target)
return;
for (const manager of findAllJointed(target))
addMultipleSelectionTargets(manager);
};
//# sourceMappingURL=selectAllJointed.js.map