Initial Menu System Commit.

This commit is contained in:
Michael Mainguy 2023-06-29 21:03:00 -05:00
parent a0aeb13fe1
commit eea59027a7
10 changed files with 122 additions and 93 deletions

View File

@ -1,6 +1,6 @@
import {RingCamera} from "../server/ring/ringCamera"; import {RingCamera} from "../server/ring/ringCamera";
export const GET = async (req, res) => { async (req, res) => {
const cams = new RingCamera(); const cams = new RingCamera();
const list = await cams.getCameras(); const list = await cams.getCameras();
@ -14,6 +14,4 @@ export const GET = async (req, res) => {
res.contentType('application/json'); res.contentType('application/json');
res.send(data); res.send(data);
} }
} }

78
package-lock.json generated
View File

@ -17,9 +17,11 @@
"@maptiler/client": "^1.5.0", "@maptiler/client": "^1.5.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"express": "^4.18.2", "express": "^4.18.2",
"express-http-proxy": "^1.6.3",
"google-static-maps-tile": "1.0.0", "google-static-maps-tile": "1.0.0",
"query-string": "^8.1.0", "query-string": "^8.1.0",
"ring-client-api": "^11.8.0" "ring-client-api": "^11.8.0",
"vite-express": "^0.9.1"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^5.0.2", "typescript": "^5.0.2",
@ -147,7 +149,6 @@
"cpu": [ "cpu": [
"arm" "arm"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"android" "android"
@ -163,7 +164,6 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"android" "android"
@ -179,7 +179,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"android" "android"
@ -195,7 +194,6 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
@ -211,7 +209,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
@ -227,7 +224,6 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"freebsd" "freebsd"
@ -243,7 +239,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"freebsd" "freebsd"
@ -259,7 +254,6 @@
"cpu": [ "cpu": [
"arm" "arm"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -275,7 +269,6 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -291,7 +284,6 @@
"cpu": [ "cpu": [
"ia32" "ia32"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -307,7 +299,6 @@
"cpu": [ "cpu": [
"loong64" "loong64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -323,7 +314,6 @@
"cpu": [ "cpu": [
"mips64el" "mips64el"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -339,7 +329,6 @@
"cpu": [ "cpu": [
"ppc64" "ppc64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -355,7 +344,6 @@
"cpu": [ "cpu": [
"riscv64" "riscv64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -371,7 +359,6 @@
"cpu": [ "cpu": [
"s390x" "s390x"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -387,7 +374,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
@ -403,7 +389,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"netbsd" "netbsd"
@ -419,7 +404,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"openbsd" "openbsd"
@ -435,7 +419,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"sunos" "sunos"
@ -451,7 +434,6 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
@ -467,7 +449,6 @@
"cpu": [ "cpu": [
"ia32" "ia32"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
@ -483,7 +464,6 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"dev": true,
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
@ -1904,11 +1884,15 @@
"has-binary2": "~1.0.2" "has-binary2": "~1.0.2"
} }
}, },
"node_modules/es6-promise": {
"version": "4.2.8",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
},
"node_modules/esbuild": { "node_modules/esbuild": {
"version": "0.17.19", "version": "0.17.19",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==", "integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
"dev": true,
"hasInstallScript": true, "hasInstallScript": true,
"bin": { "bin": {
"esbuild": "bin/esbuild" "esbuild": "bin/esbuild"
@ -2041,6 +2025,32 @@
"node": ">= 0.10.0" "node": ">= 0.10.0"
} }
}, },
"node_modules/express-http-proxy": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/express-http-proxy/-/express-http-proxy-1.6.3.tgz",
"integrity": "sha512-/l77JHcOUrDUX8V67E287VEUQT0lbm71gdGVoodnlWBziarYKgMcpqT7xvh/HM8Jv52phw8Bd8tY+a7QjOr7Yg==",
"dependencies": {
"debug": "^3.0.1",
"es6-promise": "^4.1.1",
"raw-body": "^2.3.0"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/express-http-proxy/node_modules/debug": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"dependencies": {
"ms": "^2.1.1"
}
},
"node_modules/express-http-proxy/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"node_modules/external-editor": { "node_modules/external-editor": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
@ -3121,7 +3131,6 @@
"version": "3.3.6", "version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -3363,8 +3372,7 @@
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
"dev": true
}, },
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.3.1", "version": "2.3.1",
@ -3381,7 +3389,6 @@
"version": "8.4.24", "version": "8.4.24",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz",
"integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -3725,7 +3732,6 @@
"version": "3.25.1", "version": "3.25.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.25.1.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.25.1.tgz",
"integrity": "sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==", "integrity": "sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==",
"dev": true,
"bin": { "bin": {
"rollup": "dist/bin/rollup" "rollup": "dist/bin/rollup"
}, },
@ -3994,7 +4000,6 @@
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
} }
@ -4294,7 +4299,6 @@
"version": "4.3.9", "version": "4.3.9",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz",
"integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", "integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==",
"dev": true,
"dependencies": { "dependencies": {
"esbuild": "^0.17.5", "esbuild": "^0.17.5",
"postcss": "^8.4.23", "postcss": "^8.4.23",
@ -4338,6 +4342,18 @@
} }
} }
}, },
"node_modules/vite-express": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/vite-express/-/vite-express-0.9.1.tgz",
"integrity": "sha512-tTX9gqYxiarnhcr9o4U95p0F8LavUzfDKS+5wB7eOw09XE1HSrdOJsk6dHN5H0EmhubdH12gHOs3t0pPdPh+Ag==",
"dependencies": {
"picocolors": "^1.0.0"
},
"peerDependencies": {
"express": "^4.18.2",
"vite": "^4.0.0"
}
},
"node_modules/vite-plugin-api": { "node_modules/vite-plugin-api": {
"version": "0.1.11", "version": "0.1.11",
"resolved": "https://registry.npmjs.org/vite-plugin-api/-/vite-plugin-api-0.1.11.tgz", "resolved": "https://registry.npmjs.org/vite-plugin-api/-/vite-plugin-api-0.1.11.tgz",

View File

@ -8,7 +8,7 @@
"build": "tsc && vite build", "build": "tsc && vite build",
"preview": "vite preview", "preview": "vite preview",
"havok": "node ./copyHavok.cjs", "havok": "node ./copyHavok.cjs",
"serve": "", "serve": "node server.js",
"postinstall": "cp ./node_modules/@babylonjs/havok/lib/esm/HavokPhysics.wasm ./node_modules/.vite/deps" "postinstall": "cp ./node_modules/@babylonjs/havok/lib/esm/HavokPhysics.wasm ./node_modules/.vite/deps"
}, },
"dependencies": { "dependencies": {
@ -22,7 +22,9 @@
"@maptiler/client": "^1.5.0", "@maptiler/client": "^1.5.0",
"axios": "^1.4.0", "axios": "^1.4.0",
"google-static-maps-tile": "1.0.0", "google-static-maps-tile": "1.0.0",
"query-string": "^8.1.0" "query-string": "^8.1.0",
"vite-express": "^0.9.1",
"express-http-proxy": "^1.6.3"
}, },
"devDependencies": { "devDependencies": {
"typescript": "^5.0.2", "typescript": "^5.0.2",

15
server.js Normal file
View File

@ -0,0 +1,15 @@
import express from "express";
import ViteExpress from "vite-express";
import dotenv from "dotenv";
import expressProxy from "express-http-proxy";
dotenv.config();
const app = express();
app.use("/api", expressProxy("local.immersiveidea.com"));
ViteExpress.listen(app, process.env.PORT || 3001, () => console.log("Server is listening..."));

View File

@ -1,6 +0,0 @@
export const GET = async (req, res, next) => {
res.contentType('application/json');
res.send('{"status": "OK"}');
}

View File

@ -3,17 +3,16 @@ import "@babylonjs/inspector";
import {Auth0Client, createAuth0Client} from '@auth0/auth0-spa-js'; import {Auth0Client, createAuth0Client} from '@auth0/auth0-spa-js';
import { import {
ActionManager, Angle, ArcRotateCamera,
ArcRotateCamera, Color3, CubeTexture,
Engine, Engine,
HavokPlugin, HavokPlugin,
HemisphericLight, InterpolateValueAction, HemisphericLight,
Mesh, MeshBuilder,
MeshBuilder, PBRMetallicRoughnessMaterial, PBRMetallicRoughnessMaterial,
PhotoDome,
PhysicsAggregate, PhysicsAggregate,
PhysicsShapeType, Plane, Quaternion, PhysicsShapeType,
Scene, StandardMaterial, Texture, Scene,
Texture,
Vector3, Vector3,
WebXRDefaultExperience WebXRDefaultExperience
} from "@babylonjs/core"; } from "@babylonjs/core";
@ -23,20 +22,18 @@ import {Left} from "./controllers/left";
import {Bmenu} from "./menus/bmenu"; import {Bmenu} from "./menus/bmenu";
import HavokPhysics from "@babylonjs/havok"; import HavokPhysics from "@babylonjs/havok";
import {Rigplatform} from "./controllers/rigplatform"; import {Rigplatform} from "./controllers/rigplatform";
import {ObjectEditor} from "./menus/objectEditor";
import {RingCamera} from "./server/ring/ringCamera";
import {AdvancedDynamicTexture, Image} from "@babylonjs/gui";
import {Cameras} from "./integration/ring/cameras"; import {Cameras} from "./integration/ring/cameras";
import {Gmap} from "./util/gmap";
import {Mapt} from "./util/mapt"; import {Mapt} from "./util/mapt";
class App { class App {
//preTasks = [havokModule]; //preTasks = [havokModule];
private auth0: Auth0Client; private auth0: Auth0Client;
constructor(auth0: Auth0Client) { private token: string;
constructor(auth0: Auth0Client, token: string) {
this.auth0 = auth0; this.auth0 = auth0;
this.token = token;
const canvas = document.createElement("canvas"); const canvas = document.createElement("canvas");
@ -53,7 +50,7 @@ class App {
const scene = new Scene(engine); const scene = new Scene(engine);
const havokInstance = await HavokPhysics(); const havokInstance = await HavokPhysics();
const havokPlugin = new HavokPlugin(true, havokInstance); const havokPlugin = new HavokPlugin(true, havokInstance);
scene.enablePhysics(new Vector3(0 , -9.8, 0), havokPlugin); scene.enablePhysics(new Vector3(0, -9.8, 0), havokPlugin);
const camera: ArcRotateCamera = new ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, const camera: ArcRotateCamera = new ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2,
new Vector3(0, 1.6, 0), scene); new Vector3(0, 1.6, 0), scene);
camera.attachControl(canvas, true); camera.attachControl(canvas, true);
@ -67,8 +64,10 @@ class App {
'./outdoor_field.jpeg', {}, './outdoor_field.jpeg', {},
scene); scene);
*/ */
const xr = await WebXRDefaultExperience.CreateAsync(scene, {floorMeshes: [this.createGround(scene)], const xr = await WebXRDefaultExperience.CreateAsync(scene, {
optionalFeatures: true}); floorMeshes: [this.createGround(scene)],
optionalFeatures: true
});
xr.baseExperience.camera.parent = rig.rigMesh; xr.baseExperience.camera.parent = rig.rigMesh;
const b = new Bmenu(scene, rig, xr.baseExperience); const b = new Bmenu(scene, rig, xr.baseExperience);
//const box = MeshBuilder.CreateBox("box", {size: 1}, scene); //const box = MeshBuilder.CreateBox("box", {size: 1}, scene);
@ -88,8 +87,8 @@ class App {
//const edit = new ObjectEditor(scene, box); //const edit = new ObjectEditor(scene, box);
//const edit = new ObjectEditor(scene, box); //const edit = new ObjectEditor(scene, box);
const ring = new Cameras(scene); const ring = new Cameras(scene, this.token);
ring.getCameras().then(()=> ring.createCameras()); ring.getCameras().then(() => ring.createCameras());
const stickVector = Vector3.Zero(); const stickVector = Vector3.Zero();
xr.input.onControllerAddedObservable.add((source, state) => { xr.input.onControllerAddedObservable.add((source, state) => {
@ -139,14 +138,15 @@ class App {
scene.render(); scene.render();
}); });
} }
createGround(scene) { createGround(scene) {
const groundMaterial = new PBRMetallicRoughnessMaterial("groundMaterial", scene); const groundMaterial = new PBRMetallicRoughnessMaterial("groundMaterial", scene);
const gText = new Texture("./grass1.jpeg", scene); const gText = new Texture("./grass1.jpeg", scene);
gText.uScale =40; gText.uScale = 40;
gText.vScale=40; gText.vScale = 40;
groundMaterial.baseTexture = gText; groundMaterial.baseTexture = gText;
groundMaterial.metallic =0; groundMaterial.metallic = 0;
groundMaterial.roughness=1; groundMaterial.roughness = 1;
const ground = MeshBuilder.CreateGround("ground", {width: 100, height: 100, subdivisions: 1}, scene); const ground = MeshBuilder.CreateGround("ground", {width: 100, height: 100, subdivisions: 1}, scene);
ground.material = groundMaterial; ground.material = groundMaterial;
@ -162,12 +162,16 @@ createAuth0Client({
authorizationParams: { authorizationParams: {
redirect_uri: 'https://cameras.immersiveidea.com/' redirect_uri: 'https://cameras.immersiveidea.com/'
} }
}).then(async (auth0)=> { }).then(async (auth0) => {
try { try {
const query = window.location.search; const query = window.location.search;
if (query.includes("code=") && query.includes("state=")) { if (query.includes("code=") && query.includes("state=")) {
await auth0.handleRedirectCallback(); console.log(query);
window.location.href = 'https://cameras.immersiveidea.com'; const token = await auth0.handleRedirectCallback();
history.pushState({token: token}, "", "/");
} }
const isAuthentic = await auth0.isAuthenticated(); const isAuthentic = await auth0.isAuthenticated();
@ -175,7 +179,8 @@ createAuth0Client({
await auth0.loginWithRedirect(); await auth0.loginWithRedirect();
} else { } else {
const token = await auth0.getTokenSilently(); const token = await auth0.getTokenSilently();
new App(auth0);
new App(auth0, token);
} }

View File

@ -22,6 +22,7 @@ export class Right extends Base {
init.components['xr-standard-thumbstick'] init.components['xr-standard-thumbstick']
.onAxisValueChangedObservable.add((value) => { .onAxisValueChangedObservable.add((value) => {
const ray = this.camera.getForwardRay(); const ray = this.camera.getForwardRay();
if (Math.abs(value.x) > .1) { if (Math.abs(value.x) > .1) {
this.body.setAngularVelocity(Vector3.Up().scale(value.x)); this.body.setAngularVelocity(Vector3.Up().scale(value.x));
} else { } else {

View File

@ -3,13 +3,16 @@ import axios from "axios";
export class Cameras { export class Cameras {
private scene: Scene; private scene: Scene;
private token: string;
private cameras; private cameras;
constructor(scene: Scene) { constructor(scene: Scene, token: string) {
this.scene = scene; this.scene = scene;
this.token = token;
} }
public async getCameras() { public async getCameras() {
const cameras = await axios.get('/api/cameras',{}); const cameras = await axios.get('https://local.immersiveidea.com/api/cameras',
{headers: {'Authorization': 'Bearer ' + this.token}});
this.cameras = cameras; this.cameras = cameras;
console.log(cameras); console.log(cameras);
} }
@ -25,7 +28,7 @@ export class Cameras {
const plane = MeshBuilder.CreatePlane("plane", {width: 1.6, height:.9}, this.scene); const plane = MeshBuilder.CreatePlane("plane", {width: 1.6, height:.9}, this.scene);
const materialPlane = new StandardMaterial("texturePlane", this.scene); const materialPlane = new StandardMaterial("texturePlane", this.scene);
materialPlane.diffuseTexture = new Texture("/api/cameras?id=" + id, this.scene); materialPlane.diffuseTexture = new Texture("https://local.immersiveidea.com/api/cameras?id=" + id, this.scene);
materialPlane.specularColor = new Color3(0, 0, 0); materialPlane.specularColor = new Color3(0, 0, 0);
materialPlane.backFaceCulling = false;//Allways show the front and the back of an element materialPlane.backFaceCulling = false;//Allways show the front and the back of an element
plane.material = materialPlane; plane.material = materialPlane;

9
src/menus/amenu.ts Normal file
View File

@ -0,0 +1,9 @@
export class Amenu {
private visible = false;
constructor() {
}
public toggle() {
this.visible = !this.visible;
}
}

View File

@ -1,22 +1,8 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import { pluginAPI } from "vite-plugin-api";
export default defineConfig({ export default defineConfig({
server: { server: {
port: 3001 port: 3001
}, }
plugins: [
pluginAPI({
// routeBase?: "api",
// dirs?: [{ dir: "src/api"; route: "", exclude?: ["*.txt", ".csv", "data/*.*"] }],
// include?: ["**/*.js", "**/*.ts"],
// exclude?: ["node_modules", ".git"],
// moduleId?: "virtual:vite-plugin-api",
// mapper?: { default: "use", GET: "get", ... },
// entry?: "[node_module:lib]/server.js",
// handler?: "[node_module:lib]/handler.js",
}),
],
}); });