@realsee/dnalogel
Version:
13 lines (12 loc) • 415 B
JavaScript
import { Vector3 as n } from "three";
const o = ({ x: r, y: e, z: c }) => new n(r, e, c), a = (r) => new n().fromArray(r), t = (r) => r instanceof n ? r : Array.isArray(r) ? a(r) : o(r);
function u(r) {
if (r)
return Array.isArray(r) ? typeof r[0] == "number" ? t(r) : r.map(t) : t(r);
}
export {
t as anyPositionToVector3,
a as arrayPositionToVector3,
o as positionToVector3,
u as vector3Position
};