You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Scott Witte

Intermediate

  • "Scott Witte" started this thread

Posts: 253

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

1

Thursday, July 11th 2019, 9:14pm

Possible to reload tour without page reload?

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

2

Thursday, July 11th 2019, 9:24pm

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

Intermediate

  • "Scott Witte" started this thread

Posts: 253

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

3

Friday, July 12th 2019, 12:30am

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

Friday, July 12th 2019, 9:12am

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

Intermediate

  • "Scott Witte" started this thread

Posts: 253

Location: Milwaukee, WI USA

Occupation: Professional Photographer

  • Send private message

5

Saturday, July 13th 2019, 6:55am

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...