Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose XR tracking state from WebXRCamera #9076

Closed
ryantrem opened this issue Oct 2, 2020 · 0 comments
Closed

Expose XR tracking state from WebXRCamera #9076

ryantrem opened this issue Oct 2, 2020 · 0 comments
Assignees
Milestone

Comments

@ryantrem
Copy link
Contributor

ryantrem commented Oct 2, 2020

Is your feature request related to a problem? Please describe.
The XR tracking state is not exposed from WebXRCamera (or WebXRExperienceHelper or WebXRDefaultExperience), so there is no way to adjust app behavior depending on whether the XR session has tracking or not (e.g. guide the user on how to get tracking).

Describe the solution you'd like
According to this discussion: immersive-web/webxr#243 (comment), three different tracking states can be deduced from existing WebXR state:

  1. Not yet tracking (getViewerPose returns null)
  2. Tracking lost (getViewerPose returns non-null, but XRPose.emulatedPosition is true)
  3. Tracking (getViewerPose returns non-null, and XRPose.emulatedPosition is false)

I believe these apply equally to controllers, but viewer pose is the priority for me. 😁

So at a minimum, I think we should:

  1. Define a trackingState enum with something like notYetTracking, trackingLost, and tracking.
  2. Expose the current trackingState as a property on WebXRCamera.
  3. Expose a trackingStateChanged observable on WebXRCamera.

Discussion
Discussed with @RaananW directly.

@RaananW RaananW self-assigned this Oct 2, 2020
@RaananW RaananW added this to the 4.2 milestone Oct 2, 2020
@RaananW RaananW closed this as completed Oct 5, 2020
aWeirdo added a commit to aWeirdo/Babylon.js that referenced this issue Oct 12, 2020
* nuwatz

* Nightly + Fix BabylonJS#9047

* fix BabylonJS#9048

* Nightly

* Fixed TriPlanarMappingMaterial to compute the right world normal.

* Nightly

* Added support of .waveCount to WaterMaterial to control overall wave count on grounds the material is applied on.

* Fix tiny nme crash when a node was not part of the graph

* Mouse wheel for FreeCamera: Switched off by default.

* Nightly

* Fix close ESM shadows not being set correctly in some cases

* Allow to change the size of the shadow map size

* Nightly

* Fix crash when picksprite is called with no sprite manager

* Nightly

* adding copy to gradiant in NME

* switching order

* 4.2.0-beta.7

* 4.2.0-beta.9

* disable gizmo rotation when in billboard mode

* Cross Eye support for 180 and fixing wrong offset in 180 mode
Closing BabylonJS#8897

* make our status green again!

* generate mipMaps and default behavior

* fix

* warning when using rotation gizmo with transforms in billboard mode

* nightly

* fixing bug in color4

* Fix BabylonJS#9067

* Exclude gltf clearcoat unit test from automatic testing

* Nightly

* Nightly

* Nightly

* missing semicolon

* Associated with BabylonJS#9072

* Nightly

* Nightly

* adding copy gradient step to inspector view

* cleaning up code

* Mouse wheel for FreeCamera: Add Babylon Observables.

* moving icons

* Update BaseCameraMouseWheelInput.ts

Lint: Trailing whitespace.

* Fix flash at start when using filtering methods making use of preprocesses

* freeCameraTouchInput bug.

* Fix alphatest transparency so it no-longer requires a diffuse/albedo texture if an opacityTexture is present

* Local Dev Should not touch dist

* adding a tracking-state observable for the XR camera

fixing BabylonJS#9076

* They know what is what, but they don't know what is what

* doc and a small change in setter

* material is not readonly public

* contact point in registerOnPhysicsCollide callback

* linting

* what's new

* added project to ref

* stay defensive, stay safe

* Project controller position to screen space

Fullscreen GUI in AR will work as expected.

* grün grün grün sind alle meine Tickets

* use the main camera and not the rig camera

* Fix miter issue with text outline

* Nightly

* nit

* Add more declarations to typescript playground

* Fix BabylonJS#9069 + nightly

* Fix for issue with skeleton viewer lighting. Changed skeleton viewer initialization to use utility layer for mesh creation. Added utility layer lighting creation, adjusted light intensity to show surface detail

* what's new

* fix typedoc check

* Fix default sphere layout for back compat.

* remove explicit mesh light specification

* Nightly

* Fix same submesh being rendered multiple times in the shadow map

* Fix incorrect shadows on the master mesh when using a lod mesh

* fixing compound scaling issue

* new is the new old

* cannon fix for sub-rotations

* position fix for cannon (getting position relative to parent)

* Make sure the inspector loads even without the loaders package

* Prevent exception when path has only one object

* Nightly

* Fix Inspector Texture SamplingMode and CoordMode

* Fix keyboard attachment when there is multiple canvases

* fixing has alpha

* Nightly

* remove extra line

* 4.2.0-beta.10

* Nightly

* Multiple fixes and adds to the KTX2 loader

* nit

* nit2

* MouseWheel for freeCamera: Resonse to revew comment: Type lint fix.

* MouseWheel for freeCamera: Resonse to revew comment: Fix typo in previous submission.

* Nightly

* fix linkWithMesh signature to support TransformNode instead og AbstractMesh

* Use the render output target's texture for PostProcess

related to BabylonJS#9038

* the color green to rule them all

* Fix using CSM for shadow mesh receivers using node materials

* Major changes to pointer selection

- Only one controller will have pointer selection enabled per default
- it is possible to enable pointer selection to all attached controllers
- dev can set the preferred handedness for the initial pointer selection controller
- if more than one controller is available, the pointer selection will switch between then when using the main button
- the switch feature can be disabled
- It is now possible to limit the distance of the pointer selection ray

* fix for all cameras with output render target

* Nightly

* Use RGBA format for KTX2 files that are not color data if ASTC/BC7 not available when transcoding an UASTC source picture

* Add a property to the EffectLayer class to render the bounding boxes unaffected by the effect

* Fix bbrender for instances

* Fix lint

* Add gltf playground snippets (BabylonJS#9106)

* Fix ts

* Nightly

* Fix BabylonJS#9115

* Fix BabylonJS#9116

* Nightly

* Update local sandbox to point to local files

* Clean up formatting of sandbox html

* Update wasm Draco files to 1.3.6

* Replace Array.From, which doesn't exist everywhere, with more rudimentary syntax.

* Use faster functions for loading draco data

* Fix by the comments

* remove Array.from usage from Core

* gotta love absolute positioning

* Fix IE11 shader crash

* added optional selected to options line component

* add a select tag for target bone name

* soylent green are people!

* Avoid GC when calling intersects

geometry._positions resets every frame (when bounding box updates) and recreates when mesh.intesects is called.
With large meshes this can be very costly, as vectors are constantly created and GCed (on each frame).
This keeps a cache of the positions, while keeping the current state as it is. _positions is still null or full, _positionsCache is updated when needed, reusing the vectors if possible

* green again (naturally)

* Update existing wasm modules / add new ones for RGBA

* Add new UASTC to RGBA universal transcoder support

* optimizations

* Nightly

* Nightly

* nightly

* adding manual input for gradient number value

* cleaning code

* Mouse wheel for FreeCamera: Responses to review comments.

* Mouse wheel for FreeCamera: Arg. Lint.

* Mouse wheel for FreeCamera: More responses to review comments. Enum to select camera property.

* first gamepad if no XBOX found

* green is the word

* Fix input of decimal digits that are fixed at 2

* Allow any type of inputs for smoothstep

* Don't push two times the same sampler name

* Allow reusing the CurrentScreenBlock + texture sampling in the fragment shader

* Fix validation test failing

* Allow multiple ParticleTextureBlock blocks

* get next path step point for an agent

* Move isNotColorData property to ITextureInfo

* fix documentation

* Possibility to add a comment to a NME material

* Nightly

* 4.2.0-beta.11

* Handle comments

* Fix zip download

* Handle more comments

* nit

* Fix thin instance intersection check with bounding info

* Add override for XMLHttpRequest for Babylon Native

* Update boundingBoxRenderer.ts

* Update what's new.md (#13)

* Helper function for off mesh link

* WebXR declaration update

* build adjustments

* further adjustments

* event type

* further changes

* avoid var declaration

* correct var def

* adjust canvas

* adjustment to idl

* some docs

* Adjusting to the commited typedef

* adjusting events

* correct callback

* Nightly

Co-authored-by: Raanan Weber <info@raananweber.com>
Co-authored-by: David Catuhe <david.catuhe@live.fr>
Co-authored-by: sebavan <vandenberghe.sebastien@gmail.com>
Co-authored-by: Julien MOREAU-MATHIS <moreau-mathis@intechinfo.fr>
Co-authored-by: duncan law <mrdunk@gmail.com>
Co-authored-by: Popov72 <github@evpopov.com>
Co-authored-by: Pamela Wolf <pamela.wolf@digipen.edu>
Co-authored-by: Cedric Guillemet <cedric.guillemet@gmail.com>
Co-authored-by: Pamela W <67929198+msDestiny14@users.noreply.github.com>
Co-authored-by: metaobjects <github@metaobjects.org>
Co-authored-by: Gary Hsu <bghgary@users.noreply.github.com>
Co-authored-by: Nicholas Barlow <nickmaxx@gmail.com>
Co-authored-by: marazzig <giuseppe.marazzi@examina.it>
Co-authored-by: Nicholas Barlow <whoisdrigax@gmail.com>
Co-authored-by: syntheticmagus <33846034+syntheticmagus@users.noreply.github.com>
Co-authored-by: Ryan Tremblay <ryan.tremblay@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants