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I,qBAA0BnD,KAAKkK,aAAe9G,GAAW,EAAIpD,KAAKkK,aAAe9G,EAAU,EAAGpD,KAAKkK,aAAe,EAAGlK,KAAKkK,cAAgB,EAAG,GAAK,IACjK,CACA,oBAAAY,GACI,MAAMjG,EAAO7E,KAAKe,WAAWgB,SAAS4C,UAChCvB,EAASyB,EAAK3B,EAAI2B,EAAK1B,EAC7BnD,KAAKqK,aAAatF,MAAS/E,KAAKkK,aAAe9G,EAAU,EACzDpD,KAAKqK,aAAarF,MAAShF,KAAKkK,aAAe9G,EAAU,EACzDpD,KAAKqK,aAAapF,IAAMjF,KAAKkK,aAAe,EAC5ClK,KAAKqK,aAAanF,QAAUlF,KAAKkK,aAAe,EAChDlK,KAAKqK,aAAa7J,wBACtB,CACA,YAAAgK,CAAatK,GACT,MAAMqN,EAAQF,OAAOG,OAAOxN,KAAKmK,kBACjC,IAAK,MAAM4B,KAAQwB,EACXrN,EACA6L,EAAKhE,kBAAkB0F,GAAGzN,KAAK+H,kBAAkBnE,SAGjDmI,EAAKhE,kBAAkBpE,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","dispose","reset","trigger","update","scene","controls","camera","getPosition","getTarget","sub","normalize","multiplyScalar","angle","atan2","previousBackground","background","render","getSize","resize","size","copy","left","right","top","bottom","libraryUUIDs","ProjectionManager","projection","_currentProjection","_previousDistance","matchOrthoDistanceEnabled","perspective","_currentCamera","setProjection","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","ACTION","ZOOM","middle","pCamera","oCamera","quaternion","getDistance","DOLLY","zoomTo","OrbitMode","projectionChanged","activateOrbitControls","toggle","minDistance","maxDistance","length","truckSpeed","direction","applyEuler","addScaledVector","moveTo","FirstPersonMode","getProjection","setNavigationMode","setupFirstPersonCamera","newTargetPosition","touches","two","TOUCH_ZOOM_TRUCK","PlanMode","mouseInitialized","defaultAzimuthSpeed","azimuthRotateSpeed","defaultPolarSpeed","polarRotateSpeed","mouseAction1","one","mouseAction2","TRUCK","TOUCH_TRUCK","TOUCH_ZOOM","ROTATE","OrthoPerspectiveCamera","SimpleCamera","_userInputButtons","_frustumSize","_navigationModes","Map","_orthoCamera","newOrthoCamera","preventTargetAdjustment","toggleEvents","_projectionManager","onInitialized","uiEnabled","setUI","onAspectUpdated","setOrthoCameraAspect","mainButton","tooltip","materialIconName","name","orthographic","navigation","orbit","plan","firstPerson","removeFromParent","_perspectiveCamera","toggleProjection","newProjection","toggleUserInput","enableUserInput","disableUserInput","mode","has","Error","fit","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":""}