Skip to content

Commit

Permalink
Revert "feat(react-components): Add ground plane rotation 0.52.0 (#4638
Browse files Browse the repository at this point in the history
…)"

This reverts commit 5d0d7b9.
  • Loading branch information
haakonflatval-cognite committed Jun 28, 2024
1 parent 5d0d7b9 commit 14a7dbf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 41 deletions.
2 changes: 1 addition & 1 deletion react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cognite/reveal-react-components",
"version": "0.52.0",
"version": "0.51.0",
"exports": {
".": {
"import": "./dist/index.js",
Expand Down
15 changes: 8 additions & 7 deletions react-components/src/hooks/useGroundPlaneFromScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { useSDK } from '../components/RevealCanvas/SDKProvider';
import { CDF_TO_VIEWER_TRANSFORMATION, CustomObject } from '@cognite/reveal';
import { useReveal } from '../components/RevealCanvas/ViewerContext';
import { clear } from '../architecture/base/utilities/extensions/arrayExtensions';
import { transformation3dToMatrix4 } from '../utilities/transformation3dToMatrix4';

export const useGroundPlaneFromScene = (sceneExternalId: string, sceneSpaceId: string): void => {
const { data: scene } = useSceneConfig(sceneExternalId, sceneSpaceId);
Expand Down Expand Up @@ -84,17 +83,19 @@ export const useGroundPlaneFromScene = (sceneExternalId: string, sceneSpaceId: s
}
const texture = groundPlaneTextures[index];
const material = new MeshBasicMaterial({ map: texture, side: DoubleSide });
const geometry = new PlaneGeometry(10000, 10000);
const geometry = new PlaneGeometry(10000 * groundPlane.scaleX, 10000 * groundPlane.scaleY);

geometry.name = `CogniteGroundPlane`;

const mesh = new Mesh(geometry, material);

const matrix4 = transformation3dToMatrix4(groundPlane).premultiply(
CDF_TO_VIEWER_TRANSFORMATION
mesh.position.set(
groundPlane.translationX,
groundPlane.translationY,
groundPlane.translationZ
);
mesh.matrix.copy(matrix4);
mesh.matrixAutoUpdate = false;
mesh.rotation.set(-Math.PI / 2, 0, 0);

mesh.position.applyMatrix4(CDF_TO_VIEWER_TRANSFORMATION);

const customObject = new CustomObject(mesh);
customObject.isPartOfBoundingBox = false;
Expand Down
33 changes: 0 additions & 33 deletions react-components/src/utilities/transformation3dToMatrix4.ts

This file was deleted.

0 comments on commit 14a7dbf

Please sign in to comment.