Download src/shared/entity-targets.mjs from xlt99/EmboDi: direct link, hf CLI and curl.
- Browser
- Download file 479 Bytes
-
https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/src/shared/entity-targets.mjs
- Command line
-
hf download hf://spaces/xlt99/EmboDi/src/shared/entity-targets.mjs
-
curl -L -o entity-targets.mjs https://huggingface.co/spaces/xlt99/EmboDi/resolve/main/src/shared/entity-targets.mjs
479 Bytes
| function clearEntityTargets(objects, id) { | |
| return objects.map((object) => { | |
| if (object.aimTargetId !== id && object.track?.targetId !== id) return object; | |
| const next = { ...object }; | |
| if (next.aimTargetId === id) delete next.aimTargetId; | |
| if (next.track?.targetId === id) next.track = { ...next.track, targetId: null, orientation: next.track.orientation === "target" ? "fixed" : next.track.orientation }; | |
| return next; | |
| }); | |
| } | |
| export { | |
| clearEntityTargets | |
| }; | |