UNPKG

@realsee/dnalogel

Version:
44 lines (43 loc) 1.81 kB
var c = Object.defineProperty; var G = (n, e, t) => e in n ? c(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; var r = (n, e, t) => (G(n, typeof e != "symbol" ? e + "" : e, t), t); class v { // eslint-disable-next-line max-params constructor(e, t, a, h, p, u) { r(this, "helperController"); r(this, "five"); r(this, "onFiveWantsTapGesture", (e) => { if (!this.helperController) return; const t = this.helperController.onWantsTapGesture(e); return this.five.needsRender = !0, t; }); r(this, "onFiveWantsGesture", (...e) => { if (!this.helperController) return; const t = this.helperController.onWantsGesture(...e); return this.five.needsRender = !0, t; }); r(this, "onFiveIntersectionOnModelUpdate", (...e) => { this.helperController && this.helperController.onIntersectionOnModelUpdate(...e); }); const { camera: s, model: o, scene: i } = e, l = e.getElement(); if (this.five = e, !s || !o || !l || !i) return; const d = () => { e.needsRender = !0; }; this.helperController = new t( { camera: s, model: o, originObject3D: a, helperObject3D: h, container: l, scene: i, onRender: d, sharedHooks: u }, p ), e.on("wantsTapGesture", this.onFiveWantsTapGesture), e.on("wantsGesture", this.onFiveWantsGesture), e.on("intersectionOnModelUpdate", this.onFiveIntersectionOnModelUpdate); } dispose() { var e; this.five.off("wantsTapGesture", this.onFiveWantsTapGesture), this.five.off("wantsGesture", this.onFiveWantsGesture), this.five.off("intersectionOnModelUpdate", this.onFiveIntersectionOnModelUpdate), (e = this.helperController) == null || e.dispose(); } } export { v as ControllerWrapper, v as FiveControllerWrapper };