UNPKG

@pmndrs/xr

Version:
15 lines (14 loc) 483 B
import { Mesh } from 'three'; import { updateXRPlaneGeometry } from '../plane.js'; export class XRPlaneModel extends Mesh { constructor(plane) { super(updateXRPlaneGeometry(plane, undefined)); this.onBeforeRender = () => { const newGeometry = updateXRPlaneGeometry(plane, this.geometry); if (newGeometry != this.geometry) { this.geometry.dispose(); } this.geometry = newGeometry; }; } }