Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cameraControl.panToPointer = true;
cameraControl.doublePickFlyTo = true;
cameraFlight.duration = 1.0;
cameraFlight.fitFOV = 25;
viewer.camera.eye = [-2.56, 8.38, 8.27];
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];
viewer.scene.xrayMaterial.fillAlpha = 0.1;
viewer.scene.xrayMaterial.fillColor = [0, 0, 0];
viewer.scene.xrayMaterial.edgeAlpha = 0.4;
viewer.scene.xrayMaterial.edgeColor = [0, 0, 0];
viewer.scene.highlightMaterial.fill = false;
viewer.scene.highlightMaterial.fillAlpha = 0.3;
viewer.scene.highlightMaterial.edgeColor = [1, 1, 0];
const xktLoader = new XKTLoaderPlugin(viewer);
const model = xktLoader.load({
id: "xeokit-model-" + ifcModelId,
src: xktFileUrl,
metaModelSrc: metadataFileUrl,
edges: true
});
//------------------------------------------------------------------------------------------------------------------
// Mouse over entities to highlight them
//------------------------------------------------------------------------------------------------------------------
var lastEntity = null;
viewer.scene.input.on("mousemove", function (coords) {
var hit = viewer.scene.pick({
canvasPos: coords
});
if (hit) {
if (!lastEntity || hit.entity.id !== lastEntity.id) {
getGeometry(projectId:string, modelId:number, done:Function, error:Function) {
const attachmentId = this.ifcModels.xkt_attachment_ids[modelId];
console.log(`Loading model geometry for: ${attachmentId}`);
utils.loadArraybuffer(this.pathHelper.attachmentContentPath(attachmentId), done, error);
}
}
constructor(ifcModelId, xktFileUrl, metadataFileUrl) {
const viewer = new Viewer({
canvasId: 'xeokit-model-canvas-' + ifcModelId,
transparent: true
});
const cameraControl = viewer.cameraControl;
const scene = viewer.scene;
const cameraFlight = viewer.cameraFlight;
cameraControl.panToPointer = true;
cameraControl.doublePickFlyTo = true;
cameraFlight.duration = 1.0;
cameraFlight.fitFOV = 25;
viewer.camera.eye = [-2.56, 8.38, 8.27];
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];
viewer.scene.xrayMaterial.fillAlpha = 0.1;
viewer.scene.xrayMaterial.fillColor = [0, 0, 0];
viewer.scene.xrayMaterial.edgeAlpha = 0.4;