diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index 5a31eb08..388183b6 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -288,12 +288,15 @@ export class ViewportHost { private readonly cameraForward = new Vector3(); private readonly cameraRight = new Vector3(); private readonly cameraUp = new Vector3(); + private readonly transformOrientation = new Quaternion(); + private readonly transformOrientationInverse = new Quaternion(); + private readonly transformAxisDelta = new Vector3(); private readonly fogLocalCameraPosition = new Vector3(); private readonly cameraSpherical = new Spherical(); private readonly gridHelpers: Record = { - xz: new GridHelper(40, 40, 0xcf8354, 0x4e596b), - xy: new GridHelper(40, 40, 0xcf8354, 0x4e596b), - yz: new GridHelper(40, 40, 0xcf8354, 0x4e596b) + xz: new GridHelper(VIEWPORT_GRID_VISUAL_SIZE, VIEWPORT_GRID_VISUAL_DIVISIONS, 0xcf8354, 0x4e596b), + xy: new GridHelper(VIEWPORT_GRID_VISUAL_SIZE, VIEWPORT_GRID_VISUAL_DIVISIONS, 0xcf8354, 0x4e596b), + yz: new GridHelper(VIEWPORT_GRID_VISUAL_SIZE, VIEWPORT_GRID_VISUAL_DIVISIONS, 0xcf8354, 0x4e596b) }; private readonly ambientLight = new AmbientLight(); private readonly sunLight = new DirectionalLight(); @@ -327,6 +330,7 @@ export class ViewportHost { private whiteboxSelectionMode: WhiteboxSelectionMode = "object"; private whiteboxSnapEnabled = true; private whiteboxSnapStep = DEFAULT_GRID_SIZE; + private viewportGridVisible = true; private projectAssets: Record = {}; private loadedModelAssets: Record = {}; private loadedImageAssets: Record = {};