From a0cde0faeec65e82bbf8ab24cbf4c955ab1bda14 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Fri, 6 Sep 2024 16:23:00 +1000 Subject: [PATCH] Remove Igloo experimental support. --- src/App.vue | 3 - src/igloo.ts | 10 -- src/modules/apps/igloo/Igloo.d.ts | 10 -- src/modules/apps/igloo/Igloo.js | 126 ------------------ .../avatar/controller/inputController.ts | 10 -- 5 files changed, 159 deletions(-) delete mode 100644 src/igloo.ts delete mode 100644 src/modules/apps/igloo/Igloo.d.ts delete mode 100644 src/modules/apps/igloo/Igloo.js diff --git a/src/App.vue b/src/App.vue index dce67aa2..21c52e1c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,9 +17,6 @@ import { Utility } from "@Modules/utility"; import { Client } from "@World-Client/client"; import Log from "@Modules/debugging/log"; -// FIXME: Apps - This should be handled properly. -window.useIgloo = window.location.toString().includes("?igloo=1"); - // Fetch and initialize configuration info Log.debug(Log.types.OTHER, `APP: Initialize`); Utility.initializeConfig(); diff --git a/src/igloo.ts b/src/igloo.ts deleted file mode 100644 index 1436aba7..00000000 --- a/src/igloo.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { IglooCamera } from "./modules/apps/igloo/Igloo.js"; - -declare global { - interface Window { - useIgloo: boolean; - IglooCameraInstance: IglooCamera; - } -} - -export {}; diff --git a/src/modules/apps/igloo/Igloo.d.ts b/src/modules/apps/igloo/Igloo.d.ts deleted file mode 100644 index a6f86140..00000000 --- a/src/modules/apps/igloo/Igloo.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Vector3, Scene, TransformNode } from "@babylonjs/core"; - -export class IglooCamera { - canvas: Nullable; - scene: Scene; - constructor(canvas: Nullable, scene: Scene); - follow: (object: TransformNode) => void; - setPosition: (pos: Vector3) => void; - update: () => boolean; -} diff --git a/src/modules/apps/igloo/Igloo.js b/src/modules/apps/igloo/Igloo.js deleted file mode 100644 index a9ba0a78..00000000 --- a/src/modules/apps/igloo/Igloo.js +++ /dev/null @@ -1,126 +0,0 @@ -/* eslint-disable */ -import { Mesh, ArcRotateCamera, Vector3, Viewport } from "@babylonjs/core"; - -var IglooCamera = function ( canvas, scene ) { - - // 6 perspective cameras for cubemap faces - var cameraLeft; - var cameraFront; - var cameraRight; - var cameraBack; - var cameraBottom; - var cameraTop; - - const igloomode = globalThis.useIgloo; - - // objects from main scene - this.canvas = canvas; - this.scene = scene; - - // object for igloo camera to follow, default is camera object - var follow_object; - - // calculate size of cubemap faces - var view_width = ( 1 / 6 ); // / pixel_ratio; - - var fov = 1.5708; - //var near = this.camera.near; - //var far = this.camera.far; - - // create invisible mesh for follow_object - var follow_object = Mesh.CreateBox("iglooCam", 0.1, null); - follow_object.position = new Vector3(0, 0, 0); - - cameraLeft = new ArcRotateCamera("CameraLeft", 0, 0, 0, new Vector3(1, 0, 0), scene); - cameraLeft.fov = fov; - cameraLeft.viewport = new Viewport(0, 0, view_width, 1.0); - - cameraFront = new ArcRotateCamera("CameraFront", 0, 0, 0, new Vector3(0, 0, -1), scene); - cameraFront.fov = fov; - cameraFront.viewport = new Viewport(view_width, 0, view_width, 1.0); - - cameraRight = new ArcRotateCamera("CameraRight", 0, 0, 0, new Vector3(-1, 0, 0), scene); - cameraRight.fov = fov; - cameraRight.viewport = new Viewport(view_width * 2, 0, view_width, 1.0); - - cameraBack = new ArcRotateCamera("CameraBack", 0, 0, 0, new Vector3(0, 0, 1), scene); - cameraBack.fov = fov; - cameraBack.viewport = new Viewport(view_width * 3, 0, view_width, 1.0); - - cameraBottom = new ArcRotateCamera("CameraBottom", 0, 0, 0, new Vector3(0, -1, 0), scene); - cameraBottom.fov = fov; - cameraBottom.viewport = new Viewport(view_width * 4, 0, view_width, 1.0); - - //cameraTop = new THREE.PerspectiveCamera( fov, aspect, near, far ); - cameraTop = new ArcRotateCamera("CameraFront", 0, 0, 0, new Vector3(0, 1, 0), scene); - cameraTop.fov = fov; - cameraTop.viewport = new Viewport(view_width * 5, 0, view_width, 1.0); - - if ((igloomode == 1) && (follow_object != null)) { - cameraLeft.setPosition(follow_object.position); - cameraLeft.setTarget(follow_object.position.add(new Vector3(1, 0, 0))); - - cameraFront.setPosition(follow_object.position); - cameraFront.setTarget(follow_object.position.add(new Vector3(0, 0, -1))); - - cameraRight.setPosition(follow_object.position); - cameraRight.setTarget(follow_object.position.add(new Vector3(-1, 0, 0))); - - cameraBack.setPosition(follow_object.position); - cameraBack.setTarget(follow_object.position.add(new Vector3(0, 0, 1))); - - cameraBottom.setPosition(follow_object.position); - cameraBottom.setTarget(follow_object.position.add(new Vector3(0, -1, 0))); - - cameraTop.setPosition(follow_object.position); - cameraTop.setTarget(follow_object.position.add(new Vector3(0, 1, 0))); - - scene.activeCameras.push(cameraLeft); - scene.activeCameras.push(cameraFront); - scene.activeCameras.push(cameraRight); - scene.activeCameras.push(cameraBack); - scene.activeCameras.push(cameraBottom); - scene.activeCameras.push(cameraTop); - } - - this.follow = function(object) { - follow_object = object; - this.update(); - } - - this.setPosition = function(pos) { - follow_object.position = pos; - this.update(); - } - - this.update = function() { - - if (igloomode == 1) { - - cameraLeft.setPosition(follow_object.position); - cameraLeft.setTarget(follow_object.position.add(new Vector3(1, 0, 0))); - - cameraFront.setPosition(follow_object.position); - cameraFront.setTarget(follow_object.position.add(new Vector3(0, 0, -1))); - - cameraRight.setPosition(follow_object.position); - cameraRight.setTarget(follow_object.position.add(new Vector3(-1, 0, 0))); - - cameraBack.setPosition(follow_object.position); - cameraBack.setTarget(follow_object.position.add(new Vector3(0, 0, 1))); - - cameraBottom.setPosition(follow_object.position); - cameraBottom.setTarget(follow_object.position.add(new Vector3(0, -1, 0))); - - cameraTop.setPosition(follow_object.position); - cameraTop.setTarget(follow_object.position.add(new Vector3(0, 1, 0))); - - return true; - } - else { - return false; - } - } -} - -export { IglooCamera }; diff --git a/src/modules/avatar/controller/inputController.ts b/src/modules/avatar/controller/inputController.ts index 755cba99..ff8c9acf 100644 --- a/src/modules/avatar/controller/inputController.ts +++ b/src/modules/avatar/controller/inputController.ts @@ -36,7 +36,6 @@ import { applicationStore, userStore } from "@Stores/index"; import { Renderer } from "@Modules/scene"; import { MouseSettingsController } from "@Modules/avatar/controller/inputs/mouseSettings"; import { Hysteresis } from "@Modules/utility/hysteresis"; -import { IglooCamera } from "@Modules/apps/igloo/Igloo.js"; // Custom camera controls. class ArcRotateCameraCustomInput implements ICameraInput { @@ -260,11 +259,6 @@ export class InputController extends ScriptComponent { // Bind the custom controls to the camera. this._camera.inputs.add(new ArcRotateCameraCustomInput(this._camera)); this._camera.attachControl(this._scene.getEngine().getRenderingCanvas()); - - // FIXME: Toss this into an app module. - if (window.useIgloo) { - window.IglooCameraInstance = new IglooCamera(null, this._scene); - } } } @@ -788,10 +782,6 @@ export class InputController extends ScriptComponent { return; } - if (window.useIgloo) { - window.IglooCameraInstance.setPosition(this._camera.position); - } - this._cameraObstacleDetectInfo.elapse += delta; if (this._cameraObstacleDetectInfo.elapse < this._cameraObstacleDetectInfo.detectDuration) { return;