Skip to content

Commit dbc0c76

Browse files
authored
Merge pull request #79 from De-Panther/xr-plugin-2-panther
XR Provider first step
2 parents d714c99 + d0a5196 commit dbc0c76

File tree

194 files changed

+4028
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+4028
-702
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ ExportedObj/
4141

4242
# Local server
4343
*.pem
44+
*/Assets/WebGLTemplates
45+
*/Assets/WebGLTemplates.meta

Build/Build/Build.data.unityweb

60.6 KB
Binary file not shown.

Build/Build/Build.wasm

251 KB
Binary file not shown.

Build/Build/Build.wasm.framework.unityweb

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Build/webxr.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@
186186
XRManager.prototype.onRequestARSession = function () {
187187
if (!this.isARSupported) return;
188188
navigator.xr.requestSession('immersive-ar', {
189-
requiredFeatures: ['local-floor'], // TODO: Get this value from Unity
190-
optionalFeatures: ['hand-tracking', 'hit-test']
189+
requiredFeatures: this.gameInstance.Module.WebXR.Settings.ARRequiredReferenceSpace,
190+
optionalFeatures: this.gameInstance.Module.WebXR.Settings.AROptionalFeatures
191191
}).then(async (session) => {
192192
session.isImmersive = true;
193193
session.isInSession = true;
@@ -200,8 +200,8 @@
200200
XRManager.prototype.onRequestVRSession = function () {
201201
if (!this.isVRSupported) return;
202202
navigator.xr.requestSession('immersive-vr', {
203-
requiredFeatures: ['local-floor'], // TODO: Get this value from Unity
204-
optionalFeatures: ['hand-tracking']
203+
requiredFeatures: this.gameInstance.Module.WebXR.Settings.VRRequiredReferenceSpace,
204+
optionalFeatures: this.gameInstance.Module.WebXR.Settings.VROptionalFeatures
205205
}).then(async (session) => {
206206
session.isImmersive = true;
207207
session.isInSession = true;
@@ -648,7 +648,10 @@
648648

649649
let refSpaceType = 'viewer';
650650
if (session.isImmersive) {
651-
refSpaceType = 'local-floor';
651+
refSpaceType = this.gameInstance.Module.WebXR.Settings.VRRequiredReferenceSpace[0];
652+
if (session.isAR) {
653+
refSpaceType = this.gameInstance.Module.WebXR.Settings.ARRequiredReferenceSpace[0];
654+
}
652655

653656
var onSessionEnded = this.onEndSession.bind(this);
654657
session.addEventListener('end', onSessionEnded);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../Packages/webxr-interactions/Samples~/Desert

MainProject/Assets/WebXR/Samples/Desert/Scripts/ControllerInteraction.cs

Lines changed: 0 additions & 95 deletions
This file was deleted.

MainProject/Assets/WebXR/Samples/Desert/Scripts/FPSCounter.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

MainProject/Assets/WebXR/Samples/Desert/Scripts/MouseDragObject.cs

Lines changed: 0 additions & 65 deletions
This file was deleted.

MainProject/Assets/WebXR/Samples/Desert/Scripts/SceneHitTest.cs

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)