UNPKG

@realsee/dnalogel

Version:
9 lines (8 loc) 294 B
import * as r from "three"; function y(t, o) { const { x: s, y: c } = o, n = s * 2 - 1, a = c * 2 - 1, m = new r.Vector2().fromArray([n, a]), e = new r.Raycaster(); return e.setFromCamera(m, t.camera), t.model.intersectRaycaster(e)[0]; } export { y as getIntersectFromRelativePosition };