awv3
Version:
⚡ AWV3 embedded CAD
24 lines (19 loc) • 750 B
JavaScript
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));
}
}