UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

20 lines 871 B
import { emitSelectionTarget } from "../../../events/onSelectionTarget"; import { flushMultipleSelectionTargets } from "../../../states/useMultipleSelectionTargets"; import createObject from "../../../api/serializer/createObject"; import { centroid3d } from "@lincode/math"; import { multipleSelectionTargets } from "../../../collections/multipleSelectionTargets"; export default (type) => flushMultipleSelectionTargets(() => { let fromManager; let joint; for (const toManager of multipleSelectionTargets) { if (fromManager) { joint = createObject(type); joint.from = fromManager.uuid; joint.to = toManager.uuid; Object.assign(joint, centroid3d([fromManager, toManager])); } fromManager = toManager; } emitSelectionTarget(joint); }, true); //# sourceMappingURL=createJoint.js.map