Skip to content

Commit

Permalink
chore: bump 4.12.0 (#4369)
Browse files Browse the repository at this point in the history
* chore: bump Reveal to version 4.12.0

* chore: small simplification
  • Loading branch information
haakonflatval-cognite authored Apr 10, 2024
1 parent 50db534 commit f5a4d12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion viewer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cognite/reveal",
"version": "4.11.1",
"version": "4.12.0",
"description": "WebGL based 3D viewer for CAD and point clouds processed in Cognite Data Fusion.",
"homepage": "https://github.com/cognitedata/reveal/tree/master/viewer",
"repository": {
Expand Down
15 changes: 3 additions & 12 deletions viewer/packages/cad-model/src/picking/PickingHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type PickingInput = {
x: number;
y: number;
};
scene: THREE.Scene;
camera: THREE.PerspectiveCamera;
renderer: THREE.WebGLRenderer;
domElement: HTMLElement;
Expand Down Expand Up @@ -190,19 +189,11 @@ export class PickingHandler {
}

private async intersectCadNodeDepth(input: PickingInput, async: boolean) {
const { camera, normalizedCoords, renderer, domElement, cadNodes, scene } = input;
const pickInput = {
normalizedCoords,
camera,
renderer,
domElement,
scene,
cadNodes
};
const depth = await this.pickDepth(pickInput, async);
const { camera } = input;
const depth = await this.pickDepth(input, async);

const viewZ = this.perspectiveDepthToViewZ(depth, camera.near, camera.far);
const point = this.getPosition(pickInput, viewZ);
const point = this.getPosition(input, viewZ);
const distance = new THREE.Vector3().subVectors(point, camera.position).length();
return {
distance,
Expand Down

0 comments on commit f5a4d12

Please sign in to comment.