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AMjF,KAAKwJ,aAAe,EAC5CxJ,KAAK2J,aAAazE,QAAUlF,KAAKwJ,aAAe,EAChDxJ,KAAK2J,aAAanJ,wBACtB,CACAsJ,aAAa5J,GACT,MAAM0M,EAAQF,OAAOG,OAAO7M,KAAKyJ,kBACjC,IAAK,MAAM4B,KAAQuB,EACX1M,EACAmL,EAAK3D,kBAAkBoF,GAAG9M,KAAK0H,kBAAkB7D,SAGjDwH,EAAK3D,kBAAkB9D,OAGnC,E","sources":["webpack://client-app/./node_modules/openbim-components/src/navigation/MiniMap/index.js","webpack://client-app/./node_modules/openbim-components/src/navigation/OrthoPerspectiveCamera/src/projections.js","webpack://client-app/./node_modules/openbim-components/src/navigation/OrthoPerspectiveCamera/src/orbit-mode.js","webpack://client-app/./node_modules/openbim-components/src/navigation/OrthoPerspectiveCamera/src/first-person-mode.js","webpack://client-app/./node_modules/openbim-components/src/navigation/OrthoPerspectiveCamera/src/plan-mode.js","webpack://client-app/./node_modules/openbim-components/src/navigation/OrthoPerspectiveCamera/index.js"],"sourcesContent":["import * as THREE from \"three\";\r\nimport { Event, Component, UIElement, } from \"../../base-types\";\r\nimport { Canvas, Button, RangeInput } from \"../../ui\";\r\nimport { ToolComponent } from \"../../core\";\r\nexport class MiniMap extends Component {\r\n get lockRotation() {\r\n return this._lockRotation;\r\n }\r\n set lockRotation(active) {\r\n this._lockRotation = active;\r\n if (active) {\r\n this._camera.rotation.z = 0;\r\n }\r\n }\r\n get zoom() {\r\n return this._camera.zoom;\r\n }\r\n set zoom(value) {\r\n this._camera.zoom = value;\r\n this._camera.updateProjectionMatrix();\r\n }\r\n get enabled() {\r\n return this._enabled;\r\n }\r\n set enabled(active) {\r\n this._enabled = active;\r\n const canvas = this.uiElement.get(\"canvas\");\r\n canvas.visible = active;\r\n }\r\n constructor(components) {\r\n super(components);\r\n /** {@link Disposable.onDisposed} */\r\n this.onDisposed = new Event();\r\n this.uiElement = new UIElement();\r\n this.onAfterUpdate = new Event();\r\n this.onBeforeUpdate = new Event();\r\n this.onResize = new Event();\r\n // By pushing the map to the front, what the user sees on screen corresponds with what they see on the map\r\n this.frontOffset = 0;\r\n this.overrideMaterial = new THREE.MeshDepthMaterial();\r\n this.backgroundColor = new THREE.Color(0x06080a);\r\n this._enabled = true;\r\n this._lockRotation = true;\r\n this._size = new THREE.Vector2(320, 160);\r\n this._tempVector1 = new THREE.Vector3();\r\n this._tempVector2 = new THREE.Vector3();\r\n this._tempTarget = new THREE.Vector3();\r\n this.down = new THREE.Vector3(0, -1, 0);\r\n this.updatePlanes = () => {\r\n const planes = [];\r\n const renderer = this._components.renderer.get();\r\n for (const plane of renderer.clippingPlanes) {\r\n planes.push(plane);\r\n }\r\n planes.push(this._plane);\r\n this._renderer.clippingPlanes = planes;\r\n };\r\n this.components.tools.add(MiniMap.uuid, this);\r\n const main = new Button(components);\r\n const canvas = new Canvas(components);\r\n this.uiElement.set({ main, canvas });\r\n main.materialIcon = \"map\";\r\n main.onClick.add(() => {\r\n canvas.visible = !canvas.visible;\r\n });\r\n const range = new RangeInput(components);\r\n canvas.addChild(range);\r\n this._components = components;\r\n const htmlCanvas = canvas.get();\r\n this._renderer = new THREE.WebGLRenderer({ canvas: htmlCanvas });\r\n this._renderer.setSize(this._size.x, this._size.y);\r\n const frustumSize = 1;\r\n const aspect = this._size.x / this._size.y;\r\n this._camera = new THREE.OrthographicCamera((frustumSize * aspect) / -2, (frustumSize * aspect) / 2, frustumSize / 2, frustumSize / -2);\r\n this._components.renderer.onClippingPlanesUpdated.add(this.updatePlanes);\r\n this._camera.position.set(0, 200, 0);\r\n this._camera.zoom = 0.1;\r\n this._camera.rotation.x = -Math.PI / 2;\r\n this._plane = new THREE.Plane(this.down, 200);\r\n this.updatePlanes();\r\n }\r\n async dispose() {\r\n this.enabled = false;\r\n this.uiElement.dispose();\r\n this.onBeforeUpdate.reset();\r\n this.onAfterUpdate.reset();\r\n this.onResize.reset();\r\n this.overrideMaterial.dispose();\r\n this._renderer.dispose();\r\n await this.onDisposed.trigger(MiniMap.uuid);\r\n this.onDisposed.reset();\r\n }\r\n get() {\r\n return this._camera;\r\n }\r\n async update() {\r\n if (!this.enabled)\r\n return;\r\n await this.onBeforeUpdate.trigger();\r\n const scene = this._components.scene.get();\r\n const cameraComponent = this._components.camera;\r\n const controls = cameraComponent.controls;\r\n controls.getPosition(this._tempVector1);\r\n this._camera.position.x = this._tempVector1.x;\r\n this._camera.position.z = this._tempVector1.z;\r\n if (this.frontOffset !== 0) {\r\n controls.getTarget(this._tempVector2);\r\n this._tempVector2.sub(this._tempVector1);\r\n this._tempVector2.normalize().multiplyScalar(this.frontOffset);\r\n this._camera.position.x += this._tempVector2.x;\r\n this._camera.position.z += this._tempVector2.z;\r\n }\r\n if (!this._lockRotation) {\r\n controls.getTarget(this._tempTarget);\r\n const angle = Math.atan2(this._tempTarget.x - this._tempVector1.x, this._tempTarget.z - this._tempVector1.z);\r\n this._camera.rotation.z = angle + Math.PI;\r\n }\r\n this._plane.set(this.down, this._tempVector1.y);\r\n const previousBackground = scene.background;\r\n scene.background = this.backgroundColor;\r\n this._renderer.render(scene, this._camera);\r\n scene.background = previousBackground;\r\n await this.onAfterUpdate.trigger();\r\n }\r\n getSize() {\r\n const canvas = this.uiElement.get(\"canvas\");\r\n return canvas.getSize();\r\n }\r\n async resize(size) {\r\n const canvas = this.uiElement.get(\"canvas\");\r\n if (size) {\r\n this._size.copy(size);\r\n canvas.resize(size);\r\n this._renderer.setSize(size.x, size.y);\r\n const aspect = size.x / size.y;\r\n const frustumSize = 1;\r\n this._camera.left = (frustumSize * aspect) / -2;\r\n this._camera.right = (frustumSize * aspect) / 2;\r\n this._camera.top = frustumSize / 2;\r\n this._camera.bottom = -frustumSize / 2;\r\n this._camera.updateProjectionMatrix();\r\n await this.onResize.trigger(size);\r\n }\r\n }\r\n}\r\nMiniMap.uuid = \"39ad6aad-84c8-4adf-a1e0-7f25313a9e7f\";\r\nToolComponent.libraryUUIDs.add(MiniMap.uuid);\r\n//# sourceMappingURL=index.js.map","import * as THREE from \"three\";\r\nimport CameraControls from \"camera-controls\";\r\n/**\r\n * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.\r\n */\r\nexport class ProjectionManager {\r\n get projection() {\r\n return this._currentProjection;\r\n }\r\n constructor(components, camera) {\r\n this.components = components;\r\n this._previousDistance = -1;\r\n this.matchOrthoDistanceEnabled = false;\r\n this._camera = camera;\r\n const perspective = \"Perspective\";\r\n this._currentCamera = camera.get(perspective);\r\n this._currentProjection = perspective;\r\n }\r\n /**\r\n * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.\r\n *\r\n * @param projection - the new projection to set. If it is the current projection,\r\n * it will have no effect.\r\n */\r\n async setProjection(projection) {\r\n if (this.projection === projection)\r\n return;\r\n if (projection === \"Orthographic\") {\r\n this.setOrthoCamera();\r\n }\r\n else {\r\n await this.setPerspectiveCamera();\r\n }\r\n await this.updateActiveCamera();\r\n }\r\n setOrthoCamera() {\r\n // Matching orthographic camera to perspective camera\r\n // Resource: https://stackoverflow.com/questions/48758959/what-is-required-to-convert-threejs-perspective-camera-to-orthographic\r\n if (this._camera.currentMode.id === \"FirstPerson\") {\r\n return;\r\n }\r\n this._previousDistance = this._camera.controls.distance;\r\n this._camera.controls.distance = 200;\r\n const { width, height } = this.getDims();\r\n this.setupOrthoCamera(height, width);\r\n this._currentCamera = this._camera.get(\"Orthographic\");\r\n this._currentProjection = \"Orthographic\";\r\n }\r\n // This small delay is needed to hide weirdness during the transition\r\n async updateActiveCamera() {\r\n await new Promise((resolve) => {\r\n setTimeout(() => {\r\n this._camera.activeCamera = this._currentCamera;\r\n resolve();\r\n }, 50);\r\n });\r\n }\r\n getDims() {\r\n const lineOfSight = new THREE.Vector3();\r\n this._camera.get(\"Perspective\").getWorldDirection(lineOfSight);\r\n const target = new THREE.Vector3();\r\n this._camera.controls.getTarget(target);\r\n const distance = target\r\n .clone()\r\n .sub(this._camera.get(\"Perspective\").position);\r\n const depth = distance.dot(lineOfSight);\r\n const dims = this.components.renderer.getSize();\r\n const aspect = dims.x / dims.y;\r\n const camera = this._camera.get(\"Perspective\");\r\n const height = depth * 2 * Math.atan((camera.fov * (Math.PI / 180)) / 2);\r\n const width = height * aspect;\r\n return { width, height };\r\n }\r\n setupOrthoCamera(height, width) {\r\n this._camera.controls.mouseButtons.wheel = CameraControls.ACTION.ZOOM;\r\n this._camera.controls.mouseButtons.middle = CameraControls.ACTION.ZOOM;\r\n const pCamera = this._camera.get(\"Perspective\");\r\n const oCamera = this._camera.get(\"Orthographic\");\r\n oCamera.zoom = 1;\r\n oCamera.left = width / -2;\r\n oCamera.right = width / 2;\r\n oCamera.top = height / 2;\r\n oCamera.bottom = height / -2;\r\n oCamera.updateProjectionMatrix();\r\n oCamera.position.copy(pCamera.position);\r\n oCamera.quaternion.copy(pCamera.quaternion);\r\n this._camera.controls.camera = oCamera;\r\n }\r\n getDistance() {\r\n // this handles ortho zoom to perpective distance\r\n const pCamera = this._camera.get(\"Perspective\");\r\n const oCamera = this._camera.get(\"Orthographic\");\r\n // this is the reverse of\r\n // const height = depth * 2 * Math.atan((pCamera.fov * (Math.PI / 180)) / 2);\r\n // accounting for zoom\r\n const depth = (oCamera.top - oCamera.bottom) /\r\n oCamera.zoom /\r\n (2 * Math.atan((pCamera.fov * (Math.PI / 180)) / 2));\r\n return depth;\r\n }\r\n async setPerspectiveCamera() {\r\n this._camera.controls.mouseButtons.wheel = CameraControls.ACTION.DOLLY;\r\n this._camera.controls.mouseButtons.middle = CameraControls.ACTION.DOLLY;\r\n const pCamera = this._camera.get(\"Perspective\");\r\n const oCamera = this._camera.get(\"Orthographic\");\r\n pCamera.position.copy(oCamera.position);\r\n pCamera.quaternion.copy(oCamera.quaternion);\r\n this._camera.controls.mouseButtons.wheel = CameraControls.ACTION.DOLLY;\r\n if (this.matchOrthoDistanceEnabled) {\r\n this._camera.controls.distance = this.getDistance();\r\n }\r\n else {\r\n this._camera.controls.distance = this._previousDistance;\r\n }\r\n await this._camera.controls.zoomTo(1);\r\n pCamera.updateProjectionMatrix();\r\n this._camera.controls.camera = pCamera;\r\n this._currentCamera = pCamera;\r\n this._currentProjection = \"Perspective\";\r\n }\r\n}\r\n//# sourceMappingURL=projections.js.map","import * as THREE from \"three\";\r\nimport { Event } from \"../../../base-types\";\r\n/**\r\n * A {@link NavigationMode} that allows 3D navigation and panning\r\n * like in many 3D and CAD softwares.\r\n */\r\nexport class OrbitMode {\r\n constructor(camera) {\r\n this.camera = camera;\r\n /** {@link NavigationMode.enabled} */\r\n this.enabled = true;\r\n /** {@link NavigationMode.id} */\r\n this.id = \"Orbit\";\r\n /** {@link NavigationMode.projectionChanged} */\r\n this.projectionChanged = new Event();\r\n this.activateOrbitControls();\r\n }\r\n /** {@link NavigationMode.toggle} */\r\n toggle(active) {\r\n this.enabled = active;\r\n if (active) {\r\n this.activateOrbitControls();\r\n }\r\n }\r\n activateOrbitControls() {\r\n const controls = this.camera.controls;\r\n controls.minDistance = 1;\r\n controls.maxDistance = 300;\r\n const position = new THREE.Vector3();\r\n controls.getPosition(position);\r\n const distance = position.length();\r\n controls.distance = distance;\r\n controls.truckSpeed = 2;\r\n const { rotation } = this.camera.get();\r\n const direction = new THREE.Vector3(0, 0, -1).applyEuler(rotation);\r\n const target = position.addScaledVector(direction, distance);\r\n controls.moveTo(target.x, target.y, target.z);\r\n }\r\n}\r\n//# sourceMappingURL=orbit-mode.js.map","import * as THREE from \"three\";\r\nimport CameraControls from \"camera-controls\";\r\nimport { Event } from \"../../../base-types\";\r\n/**\r\n * A {@link NavigationMode} that allows first person navigation,\r\n * simulating FPS video games.\r\n */\r\nexport class FirstPersonMode {\r\n constructor(camera) {\r\n this.camera = camera;\r\n /** {@link NavigationMode.enabled} */\r\n this.enabled = false;\r\n /** {@link NavigationMode.id} */\r\n this.id = \"FirstPerson\";\r\n /** {@link NavigationMode.projectionChanged} */\r\n this.projectionChanged = new Event();\r\n }\r\n /** {@link NavigationMode.toggle} */\r\n toggle(active) {\r\n this.enabled = active;\r\n if (active) {\r\n const projection = this.camera.getProjection();\r\n if (projection !== \"Perspective\") {\r\n this.camera.setNavigationMode(\"Orbit\");\r\n return;\r\n }\r\n this.setupFirstPersonCamera();\r\n }\r\n }\r\n setupFirstPersonCamera() {\r\n const controls = this.camera.controls;\r\n const newTargetPosition = new THREE.Vector3();\r\n controls.distance--;\r\n controls.getPosition(newTargetPosition);\r\n controls.minDistance = 1;\r\n controls.maxDistance = 1;\r\n controls.distance = 1;\r\n controls.moveTo(newTargetPosition.x, newTargetPosition.y, newTargetPosition.z);\r\n controls.truckSpeed = 50;\r\n controls.mouseButtons.wheel = CameraControls.ACTION.DOLLY;\r\n controls.touches.two = CameraControls.ACTION.TOUCH_ZOOM_TRUCK;\r\n }\r\n}\r\n//# sourceMappingURL=first-person-mode.js.map","import CameraControls from \"camera-controls\";\r\nimport { Event } from \"../../../base-types\";\r\n/**\r\n * A {@link NavigationMode} that allows to navigate floorplans in 2D,\r\n * like many BIM tools.\r\n */\r\nexport class PlanMode {\r\n constructor(camera) {\r\n this.camera = camera;\r\n /** {@link NavigationMode.enabled} */\r\n this.enabled = false;\r\n /** {@link NavigationMode.id} */\r\n this.id = \"Plan\";\r\n /** {@link NavigationMode.projectionChanged} */\r\n this.projectionChanged = new Event();\r\n this.mouseInitialized = false;\r\n this.defaultAzimuthSpeed = camera.controls.azimuthRotateSpeed;\r\n this.defaultPolarSpeed = camera.controls.polarRotateSpeed;\r\n }\r\n /** {@link NavigationMode.toggle} */\r\n toggle(active) {\r\n this.enabled = active;\r\n const controls = this.camera.controls;\r\n controls.azimuthRotateSpeed = active ? 0 : this.defaultAzimuthSpeed;\r\n controls.polarRotateSpeed = active ? 0 : this.defaultPolarSpeed;\r\n if (!this.mouseInitialized) {\r\n this.mouseAction1 = controls.touches.one;\r\n this.mouseAction2 = controls.touches.two;\r\n this.mouseInitialized = true;\r\n }\r\n if (active) {\r\n controls.mouseButtons.left = CameraControls.ACTION.TRUCK;\r\n controls.touches.one = CameraControls.ACTION.TOUCH_TRUCK;\r\n controls.touches.two = CameraControls.ACTION.TOUCH_ZOOM;\r\n }\r\n else {\r\n controls.mouseButtons.left = CameraControls.ACTION.ROTATE;\r\n controls.touches.one = this.mouseAction1;\r\n controls.touches.two = this.mouseAction2;\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=plan-mode.js.map","import * as THREE from \"three\";\r\nimport { SimpleCamera } from \"../../core/SimpleCamera\";\r\nimport { Event, UIElement } from \"../../base-types\";\r\nimport { ProjectionManager } from \"./src/projections\";\r\nimport { OrbitMode } from \"./src/orbit-mode\";\r\nimport { FirstPersonMode } from \"./src/first-person-mode\";\r\nimport { PlanMode } from \"./src/plan-mode\";\r\nimport { Button } from \"../../ui\";\r\nexport * from \"./src/types\";\r\n/**\r\n * A flexible camera that uses\r\n * [yomotsu's cameracontrols](https://github.com/yomotsu/camera-controls) to\r\n * easily control the camera in 2D and 3D. It supports multiple navigation\r\n * modes, such as 2D floor plan navigation, first person and 3D orbit.\r\n */\r\nexport class OrthoPerspectiveCamera extends SimpleCamera {\r\n constructor(components) {\r\n super(components);\r\n /**\r\n * Event that fires when the {@link CameraProjection} changes.\r\n */\r\n this.projectionChanged = new Event();\r\n this._userInputButtons = {};\r\n this._frustumSize = 50;\r\n this._navigationModes = new Map();\r\n this.uiElement = new UIElement();\r\n this._orthoCamera = this.newOrthoCamera();\r\n this._navigationModes.set(\"Orbit\", new OrbitMode(this));\r\n this._navigationModes.set(\"FirstPerson\", new FirstPersonMode(this));\r\n this._navigationModes.set(\"Plan\", new PlanMode(this));\r\n this.currentMode = this._navigationModes.get(\"Orbit\");\r\n this.currentMode.toggle(true, { preventTargetAdjustment: true });\r\n this.toggleEvents(true);\r\n this._projectionManager = new ProjectionManager(components, this);\r\n components.onInitialized.add(() => {\r\n if (components.uiEnabled)\r\n this.setUI();\r\n });\r\n this.onAspectUpdated.add(() => this.setOrthoCameraAspect());\r\n }\r\n setUI() {\r\n const mainButton = new Button(this.components);\r\n mainButton.materialIcon = \"video_camera_back\";\r\n mainButton.tooltip = \"Camera\";\r\n const projection = new Button(this.components, {\r\n materialIconName: \"camera\",\r\n name: \"Projection\",\r\n });\r\n const perspective = new Button(this.components, { name: \"Perspective\" });\r\n perspective.active = true;\r\n perspective.onClick.add(() => this.setProjection(\"Perspective\"));\r\n const orthographic = new Button(this.components, { name: \"Orthographic\" });\r\n orthographic.onClick.add(() => this.setProjection(\"Orthographic\"));\r\n projection.addChild(perspective, orthographic);\r\n const navigation = new Button(this.components, {\r\n materialIconName: \"open_with\",\r\n name: \"Navigation\",\r\n });\r\n const orbit = new Button(this.components, { name: \"Orbit Around\" });\r\n orbit.onClick.add(() => this.setNavigationMode(\"Orbit\"));\r\n const plan = new Button(this.components, { name: \"Plan View\" });\r\n plan.onClick.add(() => this.setNavigationMode(\"Plan\"));\r\n const firstPerson = new Button(this.components, { name: \"First person\" });\r\n firstPerson.onClick.add(() => this.setNavigationMode(\"FirstPerson\"));\r\n navigation.addChild(orbit, plan, firstPerson);\r\n mainButton.addChild(navigation, projection);\r\n this.projectionChanged.add((camera) => {\r\n if (camera instanceof THREE.PerspectiveCamera) {\r\n perspective.active = true;\r\n orthographic.active = false;\r\n }\r\n else {\r\n perspective.active = false;\r\n orthographic.active = true;\r\n }\r\n });\r\n this.uiElement.set({ main: mainButton });\r\n }\r\n /** {@link Disposable.dispose} */\r\n async dispose() {\r\n await super.dispose();\r\n this.toggleEvents(false);\r\n this._orthoCamera.removeFromParent();\r\n }\r\n /**\r\n * Similar to {@link Component.get}, but with an optional argument\r\n * to specify which camera to get.\r\n *\r\n * @param projection - The camera corresponding to the\r\n * {@link CameraProjection} specified. If no projection is specified,\r\n * the active camera will be returned.\r\n */\r\n get(projection) {\r\n if (!projection) {\r\n return this.activeCamera;\r\n }\r\n return projection === \"Orthographic\"\r\n ? this._orthoCamera\r\n : this._perspectiveCamera;\r\n }\r\n /** Returns the current {@link CameraProjection}. */\r\n getProjection() {\r\n return this._projectionManager.projection;\r\n }\r\n /** Match Ortho zoom with Perspective distance when changing projection mode */\r\n set matchOrthoDistanceEnabled(value) {\r\n this._projectionManager.matchOrthoDistanceEnabled = value;\r\n }\r\n /**\r\n * Changes the current {@link CameraProjection} from Ortographic to Perspective\r\n * and Viceversa.\r\n */\r\n async toggleProjection() {\r\n const projection = this.getProjection();\r\n const newProjection = projection === \"Perspective\" ? \"Orthographic\" : \"Perspective\";\r\n await this.setProjection(newProjection);\r\n }\r\n /**\r\n * Sets the current {@link CameraProjection}. This triggers the event\r\n * {@link projectionChanged}.\r\n *\r\n * @param projection - The new {@link CameraProjection} to set.\r\n */\r\n async setProjection(projection) {\r\n await this._projectionManager.setProjection(projection);\r\n await this.projectionChanged.trigger(this.activeCamera);\r\n }\r\n /**\r\n * Allows or prevents all user input.\r\n *\r\n * @param active - whether to enable or disable user inputs.\r\n */\r\n toggleUserInput(active) {\r\n if (active) {\r\n this.enableUserInput();\r\n }\r\n else {\r\n this.disableUserInput();\r\n }\r\n }\r\n /**\r\n * Sets a new {@link NavigationMode} and disables the previous one.\r\n *\r\n * @param mode - The {@link NavigationMode} to set.\r\n */\r\n setNavigationMode(mode) {\r\n if (this.currentMode.id === mode)\r\n return;\r\n this.currentMode.toggle(false);\r\n if (!this._navigationModes.has(mode)) {\r\n throw new Error(\"The specified mode does not exist!\");\r\n }\r\n this.currentMode = this._navigationModes.get(mode);\r\n this.currentMode.toggle(true);\r\n }\r\n /**\r\n * Make the camera view fit all the specified meshes.\r\n *\r\n * @param meshes the meshes to fit. If it is not defined, it will\r\n * evaluate {@link Components.meshes}.\r\n * @param offset the distance to the fit object\r\n */\r\n async fit(meshes = this.components.meshes, offset = 1.5) {\r\n if (!this.enabled)\r\n return;\r\n const maxNum = Number.MAX_VALUE;\r\n const minNum = Number.MIN_VALUE;\r\n const min = new THREE.Vector3(maxNum, maxNum, maxNum);\r\n const max = new THREE.Vector3(minNum, minNum, minNum);\r\n for (const mesh of meshes) {\r\n const box = new THREE.Box3().setFromObject(mesh);\r\n if (box.min.x < min.x)\r\n min.x = box.min.x;\r\n if (box.min.y < min.y)\r\n min.y = box.min.y;\r\n if (box.min.z < min.z)\r\n min.z = box.min.z;\r\n if (box.max.x > max.x)\r\n max.x = box.max.x;\r\n if (box.max.y > max.y)\r\n max.y = box.max.y;\r\n if (box.max.z > max.z)\r\n max.z = box.max.z;\r\n }\r\n const box = new THREE.Box3(min, max);\r\n const sceneSize = new THREE.Vector3();\r\n box.getSize(sceneSize);\r\n const sceneCenter = new THREE.Vector3();\r\n box.getCenter(sceneCenter);\r\n const radius = Math.max(sceneSize.x, sceneSize.y, sceneSize.z) * offset;\r\n const sphere = new THREE.Sphere(sceneCenter, radius);\r\n await this.controls.fitToSphere(sphere, true);\r\n }\r\n disableUserInput() {\r\n this._userInputButtons.left = this.controls.mouseButtons.left;\r\n this._userInputButtons.right = this.controls.mouseButtons.right;\r\n this._userInputButtons.middle = this.controls.mouseButtons.middle;\r\n this._userInputButtons.wheel = this.controls.mouseButtons.wheel;\r\n this.controls.mouseButtons.left = 0;\r\n this.controls.mouseButtons.right = 0;\r\n this.controls.mouseButtons.middle = 0;\r\n this.controls.mouseButtons.wheel = 0;\r\n }\r\n enableUserInput() {\r\n if (Object.keys(this._userInputButtons).length === 0)\r\n return;\r\n this.controls.mouseButtons.left = this._userInputButtons.left;\r\n this.controls.mouseButtons.right = this._userInputButtons.right;\r\n this.controls.mouseButtons.middle = this._userInputButtons.middle;\r\n this.controls.mouseButtons.wheel = this._userInputButtons.wheel;\r\n }\r\n newOrthoCamera() {\r\n const dims = this.components.renderer.getSize();\r\n const aspect = dims.x / dims.y;\r\n return new THREE.OrthographicCamera((this._frustumSize * aspect) / -2, (this._frustumSize * aspect) / 2, this._frustumSize / 2, this._frustumSize / -2, 0.1, 1000);\r\n }\r\n setOrthoCameraAspect() {\r\n const size = this.components.renderer.getSize();\r\n const aspect = size.x / size.y;\r\n this._orthoCamera.left = (-this._frustumSize * aspect) / 2;\r\n this._orthoCamera.right = (this._frustumSize * aspect) / 2;\r\n this._orthoCamera.top = this._frustumSize / 2;\r\n this._orthoCamera.bottom = -this._frustumSize / 2;\r\n this._orthoCamera.updateProjectionMatrix();\r\n }\r\n toggleEvents(active) {\r\n const modes = Object.values(this._navigationModes);\r\n for (const mode of modes) {\r\n if (active) {\r\n mode.projectionChanged.on(this.projectionChanged.trigger);\r\n }\r\n else {\r\n mode.projectionChanged.reset();\r\n }\r\n }\r\n }\r\n}\r\n//# sourceMappingURL=index.js.map"],"names":["MiniMap","lockRotation","this","_lockRotation","active","_camera","rotation","z","zoom","value","updateProjectionMatrix","enabled","_enabled","uiElement","get","visible","constructor","components","super","onDisposed","onAfterUpdate","onBeforeUpdate","onResize","frontOffset","overrideMaterial","backgroundColor","_size","_tempVector1","_tempVector2","_tempTarget","down","updatePlanes","planes","renderer","_components","plane","clippingPlanes","push","_plane","_renderer","tools","add","uuid","main","canvas","set","materialIcon","onClick","range","addChild","htmlCanvas","setSize","x","y","aspect","frustumSize","onClippingPlanesUpdated","position","Math","PI","async","dispose","reset","trigger","scene","controls","camera","getPosition","getTarget","sub","normalize","multiplyScalar","angle","atan2","previousBackground","background","render","getSize","size","copy","resize","left","right","top","bottom","ProjectionManager","projection","_currentProjection","_previousDistance","matchOrthoDistanceEnabled","perspective","_currentCamera","setOrthoCamera","setPerspectiveCamera","updateActiveCamera","currentMode","id","distance","width","height","getDims","setupOrthoCamera","Promise","resolve","setTimeout","activeCamera","lineOfSight","getWorldDirection","target","depth","clone","dot","dims","atan","fov","mouseButtons","wheel","middle","pCamera","oCamera","quaternion","getDistance","zoomTo","OrbitMode","projectionChanged","activateOrbitControls","toggle","minDistance","maxDistance","length","truckSpeed","direction","applyEuler","addScaledVector","moveTo","FirstPersonMode","getProjection","setNavigationMode","setupFirstPersonCamera","newTargetPosition","touches","two","PlanMode","mouseInitialized","defaultAzimuthSpeed","azimuthRotateSpeed","defaultPolarSpeed","polarRotateSpeed","mouseAction1","one","mouseAction2","OrthoPerspectiveCamera","SimpleCamera","_userInputButtons","_frustumSize","_navigationModes","Map","_orthoCamera","newOrthoCamera","preventTargetAdjustment","toggleEvents","_projectionManager","onInitialized","uiEnabled","setUI","onAspectUpdated","setOrthoCameraAspect","mainButton","tooltip","materialIconName","name","setProjection","orthographic","navigation","orbit","plan","firstPerson","removeFromParent","_perspectiveCamera","newProjection","toggleUserInput","enableUserInput","disableUserInput","mode","has","Error","meshes","offset","maxNum","Number","MAX_VALUE","minNum","MIN_VALUE","min","max","mesh","box","setFromObject","sceneSize","sceneCenter","getCenter","radius","sphere","fitToSphere","Object","keys","modes","values","on"],"sourceRoot":""}