You can save each hlookat, vlookat, fov, ... values before leaving a scene into an array linked to the scene name and use these values if exists when you go back to the scene.
Example : usage of arrays into the webvr.xml file.
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<vrheadsets>
<headset name="cb1" caption="Cardboard A" fov="96.0" dist="0.60" vig="100" overlap="1.0" />
<headset name="cb2" caption="Cardboard B" fov="96.0" dist="1.00" vig="100" overlap="1.1" />
<headset name="gvr" caption="GearVR" fov="112.0" dist="0.95" vig="100" overlap="1.0" />
<headset name="one" caption="VR ONE" fov="179.0" dist="5.00" vig="53" overlap="1.0" />
<headset name="hom" caption="HOMiDO" fov="101.0" dist="1.10" vig="70" overlap="1.0" />
<headset name="ccr" caption="ColorCross VR" fov="70.0" dist="0.65" vig="100" overlap="1.0" />
</vrheadsets>
<action name="myaction">
<!-- start of action -->
for(set(i,0), i LT vrheadsets.headset.count, inc(i),
copy(hs, vrheadsets.headset[get(i)]);
if(i_fov == hs.fov AND i_dist == hs.dist AND i_vig == hs.vig AND i_overlap == hs.overlap, copy(i_headset, hs.caption));
);
<!-- end of action -->
</action>
|