Merge pull request #45582 from Calinou/doc-webxrinterface-fix-code-sample-3.2

Fix WebXRInterface code sample in the class reference (3.2)
This commit is contained in:
Rémi Verschelde 2021-01-31 00:26:51 +01:00 committed by GitHub
commit a18a7fbf2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 61 additions and 59 deletions

View File

@ -10,6 +10,8 @@
Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that [WebXRInterface] is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes [WebXRInterface] quite a bit more complicated to intialize than other AR/VR interfaces. Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that [WebXRInterface] is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes [WebXRInterface] quite a bit more complicated to intialize than other AR/VR interfaces.
Here's the minimum code required to start an immersive VR session: Here's the minimum code required to start an immersive VR session:
[codeblock] [codeblock]
extends Spatial
var webxr_interface var webxr_interface
var vr_supported = false var vr_supported = false