UNPKG

@realsee/dnalogel

Version:
24 lines (23 loc) 865 B
var f = Object.defineProperty, R = Object.defineProperties; var p = Object.getOwnPropertyDescriptors; var n = Object.getOwnPropertySymbols; var u = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable; var o = (e, t, s) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, a = (e, t) => { for (var s in t || (t = {})) u.call(t, s) && o(e, s, t[s]); if (n) for (var s of n(t)) x.call(t, s) && o(e, s, t[s]); return e; }, i = (e, t) => R(e, p(t)); import * as E from "three"; function g(e, t) { const { x: s, y: m } = t, l = s * 2 - 1, y = m * 2 - 1, r = new E.Raycaster(); r.setFromCamera({ x: l, y }, e.camera); const c = e.model.intersectRaycaster(r)[0]; if (c) return i(a({}, c), { raycaster: r, isVirtual: !1 }); } export { g as getIntersectFromRelativePosition };