removed unused code.
This commit is contained in:
parent
d92f689d97
commit
397c87eeba
@ -42,9 +42,9 @@ export class Cameras {
|
|||||||
//await cam.getSnapshot();
|
//await cam.getSnapshot();
|
||||||
//const textureBlob = new Blob([photo], {type: 'image/jpeg'});
|
//const textureBlob = new Blob([photo], {type: 'image/jpeg'});
|
||||||
//const textureUrl = URL.createObjectURL(textureBlob);
|
//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.specularColor = new Color3(0, 0, 0);
|
||||||
materialPlane.backFaceCulling = false;
|
materialPlane.backFaceCulling = false;
|
||||||
plane.material = materialPlane;
|
plane.material = materialPlane;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import {Scene, Sound} from "@babylonjs/core";
|
|||||||
|
|
||||||
export class DiaSounds {
|
export class DiaSounds {
|
||||||
public static instance: DiaSounds;
|
public static instance: DiaSounds;
|
||||||
private scene: Scene;
|
private readonly scene: Scene;
|
||||||
|
|
||||||
constructor(scene: Scene) {
|
constructor(scene: Scene) {
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
@ -46,19 +46,19 @@ export class DiaSounds {
|
|||||||
return this._enter;
|
return this._enter;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _exit: Sound;
|
private readonly _exit: Sound;
|
||||||
|
|
||||||
public get exit() {
|
public get exit() {
|
||||||
return this._exit;
|
return this._exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _high: Sound;
|
private readonly _high: Sound;
|
||||||
|
|
||||||
public get high() {
|
public get high() {
|
||||||
return this._high;
|
return this._high;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _low: Sound;
|
private readonly _low: Sound;
|
||||||
|
|
||||||
public get low() {
|
public get low() {
|
||||||
return this._low;
|
return this._low;
|
||||||
|
|||||||
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user