UNPKG

awv3

Version:
24 lines (19 loc) 750 B
import * as THREE from 'three'; import Ccref from '../ccref'; export default class BaseGraphics extends THREE.Object3D { updateCoordinateSystem(coordinateSystem) { this.matrix.copy(coordinateSystem); this.matrix.decompose(this.position, this.quaternion, this.scale); this.matrixWorldNeedsUpdate = true; } updateFromGeomParams(geomParams) { this.updateCoordinateSystem(geomParams.coordinateSystem); } updateMetaBox() { this.localMesh.material.meta.box = this.updateBounds().bounds.box; } updateFromSketcherAndId(sketcher, id) { if (this.localMesh) this.localMesh.material.meta.id = id; sketcher.constraintVisualizer.updateEntity(new Ccref(sketcher, id)); } }