This commit is contained in:
2025-06-18 16:03:31 +03:00
parent ba3ac19704
commit 375b7663ee
9 changed files with 621 additions and 127 deletions
+12 -1
View File
@@ -17,6 +17,7 @@
<v-btn-toggle variant="tonal" v-model="store.prefs.xr.depthSense" class="ma-3" density="comfortable" color="green-darken-2">
<v-btn :value="true" icon="mdi-cube-outline"></v-btn>
</v-btn-toggle>
<v-btn icon="mdi-walk" @click="control"></v-btn>
</v-navigation-drawer>
<div class="container my-3 position-relative game-designer-canvas">
<div ref="target" @click="targetClick" @pointerdown="targetPointerDown"></div>
@@ -50,7 +51,8 @@
<script>
import { GameEngine } from '@/lib/gameEngine';
import { GameEngine } from '@/lib/GameEngine';
import { Hero } from '@/lib/Hero';
import { useAppStore } from '@/stores/app';
const store = useAppStore();
@@ -152,6 +154,7 @@ export default {
//await gameEngine.loadPanorama(`/asset/default/43.webp`);
await this.expandScenarioData(scene);
//gameEngine.activeObjects.scale.set(0.033, 0.033, 0.033)
gameEngine.activeObjects.clear();
target.objects = target.objects || {};
let l = target.objects;
if (this.scene.data.$environment.type == 'panorama2d'){
@@ -165,6 +168,10 @@ export default {
let gltf = await gameEngine.load(`/asset/default/${i.data.$go.asset.name}`);
this.setObjectAttributes(l, i.data, gltf, 10);
gameEngine.activeObjects.add(gltf.scene);
if (i.data.$go.type == 'player3d'){
let hero = new Hero(gltf, i.data.$go);
hero.init(gameEngine);
}
//console.log(JSON.stringify(l));
//window.gameEngine = gameEngine;
//console.log(new gameEngine.$.Euler({"isEuler":true,"_x":0,"_y":0,"_z":0,"_order":"XYZ"}));
@@ -221,6 +228,10 @@ export default {
gameEngine.resize(r.clientWidth, r.clientHeight);
//this.zoom = Math.min(r.clientWidth / this.viewBox.w, r.clientHeight / this.viewBox.h);
},
control(){
gameEngine.hero.lockControls();
}
}
}
</script>