question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SpatialUnderstandingExample needs to have UI fixed

See original GitHub issue

Trying out the SpatialUnderstandingExample I noticed that the buttons kept flickering when you keep your cursor on them. Turns out the GazeManager keeps cycling through the different layers of the UI elements and fires GazeManager_FocusedChanged of the InputManager constantly.

How to reproduce:

  1. Open SpatialUnderstandingExample scene in the Unity-Editor.
  2. Scan the room till you can complete the scan process to get the UI to pop up.
  3. Place your cursor on any layered UI elements (tab buttons, regular buttons).
  4. GazeManager will now keep firing focus changed event with the different elements in layers under the cursor.

For exampling just printing the name of the HitObject element when placing the cursor on one of the buttons and leaving it there for a few seconds: hitobject

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Zod-commented, Apr 19, 2017

I did some more testing and found more issues. It’s not just the regression that causes the focus change firing, it only makes it slightly worse. Here doing the same reproduction steps with a commit just before the merge: capture

The issue is that with this UI setup, raycasts simply don’t work. I think the general idea behind the current design is wrong or has to be used differently. The main issue is that the UI all exists in the same plane. The canvas and all it’s child ui elements have the same z-coordinate so they all have the same distance to the camera. However because of floating point variations in the raycast calculations it will alwas choose a random one that is the “clostest”.

The 3D raycast will choose a random ui-element of the canvas layer which will then be compared to a different random ui-element from the ui raycast. The regression only adds a few more randomly selected ui-elements for the second one which makes it worse.

A solution would be to add a small z-position to every single ui element so that the raycasts can actually detect the depth that they have. Like this the current system could be kept but every ui would have to be set up like this.

My second idea would be to have different layers for the canvas and its ui-elements. Only the canvas itself would be hit by the 3D raycast but not any of the ui-elements. After detecting a canvas got hit we then can do a ui raycast for the other layer where we determine which is the top element by their depth in the canvas.

1reaction
Ben-Howard-bencinStudioscommented, May 15, 2017

Thanks @Zod- , and thanks @kmikkel … going with ease on this one, the z-value offset seems to have worked for the most part, still very subtle flicker when button or input field is gazed at, but notably better both visually and functionally. Was the quick hack I needed to meet the deadline, thanks all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spatial mapping - Mixed Reality
Spatial mapping provides a detailed representation of real-world surfaces in the environment around the HoloLens.
Read more >
#Hololens – Spatial Understanding vs Spatial Mapping, and a ...
Spatial Mapping is the asset that we use by default and is the one which allows us to have basic control over the...
Read more >
Designing Spatial UI: Part 6. Understanding 3D Coordinates ...
To understand the position in three-dimensional space, we need three values expressed as x, y, and z-axes of the coordinate frame.
Read more >
Spatial Understanding Tutorial | The Open Augmented ...
In this tutorial I will give you an overview of spatial understanding, demonstrate the use of solvers and show how we can use...
Read more >
Spatial layout | Apple Developer Documentation
Spatial layout techniques help you take advantage of the infinite canvas of Apple Vision Pro and present your content in engaging, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found