-
Notifications
You must be signed in to change notification settings - Fork 6
/
gametest.html
208 lines (186 loc) · 6.57 KB
/
gametest.html
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!-- Cormon VR Experience - Virtual Reality on the Modern Web
Copyright (C) 2023-2024 Yanis M., Matthieu Farcot
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. -->
<html>
<head>
<title>What Are You Doing.</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<!-- Modules Requiring -->
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<!-- <script src="./js/modules/cursor-teleport.js"></script> -->
<!-- I love supermedium -->
<script src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
<script src="./js/modules/cursor-teleport.js"></script>
<script src="./js/modules/blink-controls.js"></script>
<script src="./js/modules/templace.js"></script>
<script>
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
AFRAME.registerComponent("switch", {
init: function () {
console.log("int")
this.on = true
this.click = this.click.bind(this)
this.el.addEventListener('click', this.click)
},
click: async function () {
console.log("clicked")
let ins = document.querySelector("#corridorlight")
this.on = !this.on
for (let index = 1; index < 10; index++) {
let num = (this.on) && 10 - (index - 1) || index
console.log(num)
let ok = ins.querySelector(`#cool${num}`)
if (!ok) continue;
ok.setAttribute("visible", this.on)
console.log(ok)
await sleep(200)
}
}
});
</script>
</head>
<body>
<a-scene
cursor="rayOrigin: mouse; fuse: false"
stats
raycaster="objects: .raycastable"
>
<a-assets>
<a-asset-item
id="frise"
src="./resources/objects/frises/CPGE.obj"
></a-asset-item>
<a-asset-item id="door" src="./resources/objects/game/infosectest1/Open/please.gltf"></a-asset-item>
</a-assets>
<!-- Navigation -->
<a-entity
obj-model="obj: #frise"
position="0 -3.3 0"
scale="10 1 10"
modify-materials
visible="false"
></a-entity>
<a-ring
id="navigation"
position="0 -1.5 0"
wireframe="true"
opacity="0.25"
color="red"
radius-inner="1"
radius-outer="2"
rotation="-90 0 0"
visible="false"
>
</a-ring>
<script id="NA" type="text/html"></script>
<!-- Camera -->
<a-entity
id="rig"
position="0 0 -.6"
character
movement-controls
nipple-controls="mode: static"
cursor-teleport="cameraRig: #rig; cameraHead: #cur_camera; collisionEntities: .boom; YLimit: .2"
>
<!-- VR -->
<a-entity
controller
id="leftController"
laser-controls="hand: left"
blink-controls="cameraRig: #rig; teleportOrigin: #cur_camera; collisionEntities: .boom;"
raycaster="objects: .raycastable"
></a-entity>
<a-entity
controller
id="rightController"
laser-controls="hand: right"
blink-controls="cameraRig: #rig; teleportOrigin: #cur_camera; collisionEntities: .boom;"
raycaster="objects: .raycastable"
></a-entity>
<a-entity id="leftHand" hand-tracking-controls="hand: left"></a-entity>
<a-entity
id="rightHand"
hand-tracking-controls="hand: right"
></a-entity>
<a-entity
id="cur_camera"
camera="far: 1000000"
position="0 1.6 0"
rotation="0 90 0"
look-controls
animation__1="property: camera.far; to: 100 ; dur: 500; easing: linear; startEvents: start_trans"
animation__2="property: camera.far; from: 100; to: 1000; dur: 500; easing: linear; startEvents: end_trans"
>
<a-light
id="flash"
light="type: spot; angle: 10; decay: 10; penumbra: 1"
position="0.31713 -0.4947 0.0679"
visible="false"
></a-light>
<a-sphere position="0 -.5 0" radius=".3" scale="1 1.5 .7"></a-sphere>
<a-entity
spotinfo
id="NotifPanel"
position="0 0 -1.5"
visible="true"
geometry="primitive: plane; width: 1.5; height: 1"
material="color: #333333; shader: flat; transparent: false"
class="raycastable"
>
<a-entity
id="Info_Description"
position="-0.51997 0.00006 0.01288"
text="shader: msdf; anchor: left; font: https://cdn.aframe.io/examples/ui/Viga-Regular.json; align: center; color: white; value: N/A"
></a-entity>
</a-entity>
</a-entity>
</a-entity>
<!-- Menu -->
<a-box
id="Menu"
position=".7 1.3 -1.8"
anchor="center"
color="#4CC3D9"
scale=".25 .04 .1"
rotation="90 180 90"
opacity=".6"
>
<a-entity
redirect="index.html"
position=".3 -.53 .04"
rotation="0 0 180"
scale="1 1 2.5"
obj-model="obj: ./resources/objects/menu/home.obj"
modify-materials
class="raycastable"
>
</a-entity>
<a-box
audiohandler
sound="src: url(./resources/sounds/cool.mp3); volume: .5; loop: true"
position="0 -.53 .04"
rotation="0 0 180"
scale="1 1 2.5"
obj-model="obj: ./resources/objects/menu/mute.obj"
modify-materials
class="raycastable"
>
</a-box>
</a-box>
<!-- Main Scene -->
<a-entity id="MainScene" scene-init template="src: #NA" />
</a-scene>
</body>
<!-- Main Scripts -->
<script src="./js/main.js"></script>
</html>