VR headset object management
This commit is contained in:
@@ -75,7 +75,7 @@ export default{
|
||||
this.animations = gltf.animations.map(a => ({
|
||||
name: a.name, id: a.uuid
|
||||
}));
|
||||
//gameEngine.autoScale(gltf.scene);
|
||||
gameEngine.autoScale(gltf.scene);
|
||||
let bb = new gameEngine.$.Box3().setFromObject(gltf.scene);
|
||||
gltf.scene.traverse(function (o) {
|
||||
o.frustumCulled = false;
|
||||
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
data(){
|
||||
return {
|
||||
query: {
|
||||
type: { $in: this.$p.objectTypes.filter(t=>t.type == this.type || !this.type).map(t=>t.value) }
|
||||
type: { $in: this.$p.objectTypes.filter(t=>!this.type || this.type.includes(t.type)).map(t=>t.value) }
|
||||
},
|
||||
activatorProps:{},
|
||||
dialog: false
|
||||
|
||||
@@ -163,7 +163,7 @@ export default {
|
||||
}
|
||||
for (let i of this.scene.data.items || []) {
|
||||
let gltf = await gameEngine.load(`/asset/default/${i.data.$go.asset.name}`);
|
||||
this.setObjectAttributes(l, i.data, gltf, 10);
|
||||
this.setObjectAttributes(l, i.data, gltf, 1);
|
||||
gameEngine.activeObjects.add(gltf.scene);
|
||||
//console.log(JSON.stringify(l));
|
||||
//window.gameEngine = gameEngine;
|
||||
@@ -175,6 +175,9 @@ export default {
|
||||
// gameEngine.activeObjects.add(camera);
|
||||
// this.setObjectAttributes(l, { id: 'camera', 'title': 'Main camera' }, { scene: camera })
|
||||
// cameraHelper.update();
|
||||
|
||||
//this is needed cause when mounted canvas has different size
|
||||
this.resize();
|
||||
},
|
||||
async expandScenarioData(scene){
|
||||
scene.data.$environment = (await this.$api.gameObject.load(scene.data.environment)).data
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="container my-3 position-relative game-designer-canvas">
|
||||
<div ref="target" @click="targetClick" @pointerdown="targetPointerDown"></div>
|
||||
</div>
|
||||
<v-toolbar density="compact">
|
||||
<!-- <v-toolbar density="compact">
|
||||
<v-slide-group show-arrows>
|
||||
<v-slide-group-item v-for="(a, i) in objectAnimations" :key="i" v-slot="{ isSelected }">
|
||||
<v-btn :color="isSelected ? 'primary' : undefined" class="ma-2"
|
||||
@@ -31,7 +31,7 @@
|
||||
</v-btn>
|
||||
</v-slide-group-item>
|
||||
</v-slide-group>
|
||||
</v-toolbar>
|
||||
</v-toolbar> -->
|
||||
<v-navigation-drawer location="right">
|
||||
<v-list v-model:selected="scenesList" selectable color="primary">
|
||||
<v-list-item v-for="(s, i) in scenes" :key="i" :title="s.data.title" :value="s"></v-list-item>
|
||||
@@ -166,7 +166,7 @@ export default {
|
||||
}
|
||||
for (let i of this.scene.data.items || []) {
|
||||
let gltf = await gameEngine.load(`/asset/default/${i.data.$go.asset.name}`);
|
||||
this.setObjectAttributes(l, i.data, gltf, 10);
|
||||
this.setObjectAttributes(l, i.data, gltf, 1);
|
||||
gameEngine.activeObjects.add(gltf.scene);
|
||||
if (i.data.$go.type == 'player3d'){
|
||||
let hero = new Hero(gltf, i.data.$go);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</g>
|
||||
</teleport>
|
||||
<v-card v-if="selected" :title="modelValue.title" class="mx-2" variant="text">
|
||||
<asset-selector @select="assignGameObject" type="GameObject">
|
||||
<asset-selector @select="assignGameObject" :type="['GameObject', 'Player']">
|
||||
<template v-slot:activator="props">
|
||||
<v-btn v-bind="props" prepend-icon="mdi-panorama-outline" color="success" block>Choose game object</v-btn>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</g>
|
||||
</teleport>
|
||||
<v-card :title="modelValue.title" v-if="selected" class="mx-2" variant="text">
|
||||
<asset-selector @select="assignEnvironment" type="Scene">
|
||||
<asset-selector @select="assignEnvironment" :type="['Scene']">
|
||||
<template v-slot:activator="props">
|
||||
<v-btn v-bind="props" prepend-icon="mdi-panorama-outline" block color="success" class="py-4">Choose environment</v-btn>
|
||||
</template>
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
target: null,
|
||||
assetSelector: {
|
||||
active: false,
|
||||
type: 'Scene'
|
||||
type: ['Scene']
|
||||
},
|
||||
dialog: false,
|
||||
expandDrawer: false,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</g>
|
||||
</teleport>
|
||||
<v-card v-if="selected" :title="modelValue.title" class="mx-2" variant="text">
|
||||
<asset-selector @select="assignTaskIntro" type="Descriptive">
|
||||
<asset-selector @select="assignTaskIntro" :type="['Descriptive']">
|
||||
<template v-slot:activator="props">
|
||||
<v-btn v-bind="props" prepend-icon="mdi-panorama-outline" color="success" block>Choose task description</v-btn>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user