Hello,
How can i get that my xml is in vr mode or not as i want to do some extra different functionality when my xml is in vr mode, how can i do this??
Thank You
Hello,
How can i get that my xml is in vr mode or not as i want to do some extra different functionality when my xml is in vr mode, how can i do this??
Thank You
Hi,
the WebVR plugin offers 'onentervr' and 'onexitvr' events:
https://krpano.com/plugins/webvr/#onentervr
https://krpano.com/plugins/webvr/#onexitvr
They will be called when entering or leaving VR mode. You could use them to dynamically modify anything.
For getting the current state there is the 'isenabled' setting:
https://krpano.com/plugins/webvr/#isenabled
Maybe have also a look into the webvr.xml for more information and usage examples.
Best regards,
Klaus
Hi Klaus,
I have a special case that is perplexing me, an attribute in a style element that should be set (reset?) depending on the webvr state. I thought I could use calc but maybe not??
I've tried with and without parentheses. The alternative value (0.5) is selected even when in VR mode. That may be because when the XML is loaded we aren't in VR mode?
My workaround (it feels inelegant) is to test each hotspot for a defining attribute (eg: style="detail_hs") and dynamically change scale when entering or exiting VR Mode. Is that best practice?
this seems wrong to me
calc:(webvr
Not sure if that is the case though
Tuur
Hi Tuur,
I believe you were suggesting removing the colon. Doing so breaks the evaluation, and I notice in the docs that it is required.
Rereading the docs about the <style> element I realize that my suspicion is correct. The evaluation takes place as the XML is loaded and will not change after. So, the "workaround" of testing each hotspot for a condition and changing the attribute seems to be the best and only practice.
Hi,
the 'calc:' will be resolved only once at xml-parsing time - and at this time there is no webvr.isenabled variable defined and so that expression is always false.
For dynamic changes the onentervr/onexitvr events and dynamic code would need to be used.
Best regards,
Klaus
Don’t have an account yet? Register yourself now and be a part of our community!