From 397c87eebaa1a6fd161175d9cd3c77320850b06b Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Tue, 1 Aug 2023 15:05:34 -0500 Subject: [PATCH] removed unused code. --- src/integration/ring/cameras.ts | 4 +-- src/util/diaSounds.ts | 8 ++--- src/util/gmap.ts | 53 --------------------------------- src/util/mapt.ts | 45 ---------------------------- 4 files changed, 6 insertions(+), 104 deletions(-) delete mode 100644 src/util/gmap.ts delete mode 100644 src/util/mapt.ts diff --git a/src/integration/ring/cameras.ts b/src/integration/ring/cameras.ts index 742bf34..25e8301 100644 --- a/src/integration/ring/cameras.ts +++ b/src/integration/ring/cameras.ts @@ -42,9 +42,9 @@ export class Cameras { //await cam.getSnapshot(); //const textureBlob = new Blob([photo], {type: 'image/jpeg'}); //const textureUrl = URL.createObjectURL(textureBlob); - const imageText = new Texture("", this.scene); - materialPlane.diffuseTexture = imageText; + + materialPlane.diffuseTexture = new Texture("", this.scene); materialPlane.specularColor = new Color3(0, 0, 0); materialPlane.backFaceCulling = false; plane.material = materialPlane; diff --git a/src/util/diaSounds.ts b/src/util/diaSounds.ts index ef4a84e..bf21c09 100644 --- a/src/util/diaSounds.ts +++ b/src/util/diaSounds.ts @@ -3,7 +3,7 @@ import {Scene, Sound} from "@babylonjs/core"; export class DiaSounds { public static instance: DiaSounds; - private scene: Scene; + private readonly scene: Scene; constructor(scene: Scene) { this.scene = scene; @@ -46,19 +46,19 @@ export class DiaSounds { return this._enter; } - private _exit: Sound; + private readonly _exit: Sound; public get exit() { return this._exit; } - private _high: Sound; + private readonly _high: Sound; public get high() { return this._high; } - private _low: Sound; + private readonly _low: Sound; public get low() { return this._low; diff --git a/src/util/gmap.ts b/src/util/gmap.ts deleted file mode 100644 index db3dce3..0000000 --- a/src/util/gmap.ts +++ /dev/null @@ -1,53 +0,0 @@ -import {Angle, Color3, MeshBuilder, Scene, StandardMaterial, Texture} from "@babylonjs/core"; -import googleStaticMapsTile from "google-static-maps-tile"; -import log from "loglevel"; - -export class Gmap { - private readonly scene: Scene; - - constructor(scene: Scene) { - this.scene = scene; - } - - public async createMapTiles(lat, lon) { - log.debug('createMapTiles', lat, lon) - googleStaticMapsTile({ - areaSize: '2560x2560', - center: '26.443397,-82.111512', - zoom: 12, - imagePerLoad: 50, - durationBetweenLoads: 60 * 1000 + 100, - key: 'AIzaSyD4jJCYcIvHDEiOkVxC2c4zNYRqZKYHMMk', - maptype: 'satellite' - }) - .on('progress', function (info) { - const image = info.image; - image.style.position = 'absolute'; - image.style.left = info.data.x + 'px'; - image.style.top = info.data.y + 'px'; - document.body.appendChild(image); - }); - } - - public createMap(lat, lon) { - //const lat = 42.3369513; - //const lon = -88.8707076; - - const plane = MeshBuilder.CreatePlane("plane", {width: 1, height: 1}, this.scene); - const materialPlane = new StandardMaterial("texturePlane", this.scene); - const zoom = 10; - - - materialPlane.diffuseTexture = - new - Texture(`https://maps.googleapis.com/maps/api/staticmap?center=${lat},${lon}&zoom=${zoom}&size=640x640&key=AIzaSyD4jJCYcIvHDEiOkVxC2c4zNYRqZKYHMMk`, - this.scene); - materialPlane.specularColor = new Color3(0, 0, 0); - materialPlane.backFaceCulling = false;//Allways show the front and the back of an element - plane.material = materialPlane; - plane.rotation.x = Angle.FromDegrees(90).radians(); - plane.rotation.y = Angle.FromDegrees(180).radians(); - plane.position.y = 0.1; - plane.position.z = -5; - } -} diff --git a/src/util/mapt.ts b/src/util/mapt.ts deleted file mode 100644 index 3e87ee2..0000000 --- a/src/util/mapt.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as maptilerClient from '@maptiler/client'; -import {Angle, Color3, MeshBuilder, Scene, StandardMaterial, Texture} from "@babylonjs/core"; - -export class Mapt { - private readonly scene: Scene; - - constructor(scene: Scene) { - this.scene = scene; - } - - buildMapImage() { - - maptilerClient.config.apiKey = '073I3Pfe4lzoSf8tNriR'; - - const link = maptilerClient.staticMaps.centered( - [-88.8711198, 42.3370588], - 14, - {width: 2048, height: 2048, style: 'streets-v2'} - ); - const plane = MeshBuilder.CreatePlane("plane", {width: 10, height: 10}, this.scene); - const materialPlane = new StandardMaterial("texturePlane", this.scene); - const sphere = MeshBuilder.CreateSphere("cams", {diameter: .1}, this.scene); - sphere.position.y = 0.2; - sphere.position.z = -5; - const sphereMaterial = new StandardMaterial("sphere", this.scene); - sphereMaterial.diffuseColor = Color3.Blue(); - sphereMaterial.ambientColor = Color3.Blue(); - - sphere.visibility = 0.8; - - materialPlane.diffuseTexture = - new - Texture(link, - this.scene); - materialPlane.specularColor = new Color3(0, 0, 0); - materialPlane.backFaceCulling = false;//Allways show the front and the back of an element - plane.material = materialPlane; - plane.rotation.x = Angle.FromDegrees(90).radians(); - plane.rotation.y = Angle.FromDegrees(180).radians(); - plane.position.y = 0.1; - plane.position.z = -5; - - } - -} \ No newline at end of file