Sie sind nicht angemeldet.

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 382

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

1

Donnerstag, 11. Juli 2019, 21:14

Possible to reload tour without page reload?

How do you reload a tour to its initial state without reloading the HTML page?

2

Donnerstag, 11. Juli 2019, 21:24

there is no built in way to do that...
you can load the start scene, but depending on what you do in your tour, everything with keep=true may have been altered.
a way would be to backup the important values at start and have a small reset action

what is the problem with a reload?
i have a home button in the toolbar which simple reloads the page

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 382

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

3

Freitag, 12. Juli 2019, 00:30

what is the problem with a reload?

Nothing crucial. The extra time of loading the HTML page. The visually jarring loss of all the HTML elements before redrawing the page.

At the moment I'm developing a headset interface for a tourist center. When one person is done I want the tour to automatically reset to its initial state for the next user. For instance, taking off a GearVR headset causes it to jump out of VR (using a web browser). I can use the onexitvr event to reset the tour. However, it doesn't actually execute until the next person puts on the headset. If I do a page reload using location.reload(), you first see the pano last viewed by the previous user, then everything goes to black and reloads. Tolerable but not elegant. If I could simply do something like loadxml(tour.xml); -- which doesn't work -- it might be more elegant. So looks like reloading the initial scene and explicitly resetting everything is the way to go. A bit more work but nothing too taxing.

4

Freitag, 12. Juli 2019, 09:12

it really depends on the tour...
if it is something simple loading the first scene, and restoring a few backuped variables (mainly the view) would do it

the 2nd thing you could do is alter the vtourskin:
in the action skin_webvr_setup the skin_settings.loadscene_flags are set up for vr mode
what you need is maybe just a loadscene() call of your first scene
without MERGE|KEEPVIEW|KEEPMOVING

Scott Witte

Fortgeschrittener

  • »Scott Witte« ist der Autor dieses Themas

Beiträge: 382

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

5

Samstag, 13. Juli 2019, 06:55

It has been proving problematic. In Gear VR and GO the tour drops out of VR shortly after taking off the headset. I use a custom splash screen to start VR and being a layer it disappears in VR but shows when you drop out of VR. On the Go I just click it and reenter VR. On Gear VR I have to hit it at least twice and sometimes only a page reload works. I've used both the webvr_onexitvr event and the button click to do the start scene reload and reinitialize certain variables. Still nothing perfect.

Ah, the joys of programming...