-
Notifications
You must be signed in to change notification settings - Fork 2
/
Scene02.vue
75 lines (69 loc) · 1.74 KB
/
Scene02.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
<div class="scene-02-container">
<PolygonjsScene
:loadFunction="loadFunction"
:sceneName="'scene_02'"
@sceneready='onSceneReady'
/>
<div class="controls disable-select">
<input type="range" min="0.1" max="0.6" step="0.01" v-model="size"/>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, watch, computed } from "vue";
import { PolygonjsScene } from "@polygonjs/vue3";
import { loadScene_scene_02 } from "@/polygonjs/scenes/scene_02/autogenerated/loadScene";
import { PolySceneWithNodeMap_scene_02 } from "@/polygonjs/scenes/scene_02/autogenerated/PolySceneWithNodeMap";
export default defineComponent({
name: "scene-02",
components: {
PolygonjsScene,
},
setup() {
let scene: PolySceneWithNodeMap_scene_02|undefined
const size = ref(0.2)
watch(size, updateSize);
function updateSize(){
if(!scene){
return
}
scene.node('/rhino/fuse1').p.dist.set(size.value);
}
function onSceneReady(loadedScene: PolySceneWithNodeMap_scene_02){
scene = loadedScene;
updateSize();
}
const loadFunction = computed(()=>loadScene_scene_02)
return {
loadFunction,
onSceneReady,
size
};
},
});
</script>
<style scoped>
.scene-02-container {
position: relative;
}
.controls {
position: absolute;
top: 0px;
left: 0px;
padding: 10px;
width: 100%;
pointer-events: none;
}
.controls input {
pointer-events: auto;
width: 95%;
}
.disable-select {
user-select: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
</style>