awv3
Version:
⚡ AWV3 embedded CAD
38 lines (29 loc) • 1.19 kB
JavaScript
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import * as THREE from 'three';
import Ccref from '../ccref';
var BaseGraphics =
/*#__PURE__*/
function (_THREE$Object3D) {
_inheritsLoose(BaseGraphics, _THREE$Object3D);
function BaseGraphics() {
return _THREE$Object3D.apply(this, arguments) || this;
}
var _proto = BaseGraphics.prototype;
_proto.updateCoordinateSystem = function updateCoordinateSystem(coordinateSystem) {
this.matrix.copy(coordinateSystem);
this.matrix.decompose(this.position, this.quaternion, this.scale);
this.matrixWorldNeedsUpdate = true;
};
_proto.updateFromGeomParams = function updateFromGeomParams(geomParams) {
this.updateCoordinateSystem(geomParams.coordinateSystem);
};
_proto.updateMetaBox = function updateMetaBox() {
this.localMesh.material.meta.box = this.updateBounds().bounds.box;
};
_proto.updateFromSketcherAndId = function updateFromSketcherAndId(sketcher, id) {
if (this.localMesh) this.localMesh.material.meta.id = id;
sketcher.constraintVisualizer.updateEntity(new Ccref(sketcher, id));
};
return BaseGraphics;
}(THREE.Object3D);
export { BaseGraphics as default };