MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Gaze cursor lerps behind virtual rotation

Open Alexees opened this issue 7 years ago • 3 comments

Overview

Whenever you use the analogue stick for rotation, your view gaze is left behind during that motion, probably due to smoothed movement towards the gaze center, without taking virtual rotation into account.

Expected Behavior

the gaze stays centered

Actual Behavior

the gaze gets thrown off when rotating

Steps to reproduce

Just out of pure luck I used the DefaultButton Material on a floor which lets the gaze highlight the position. Then rotation clearly shows how the gaze tries to get back to view center.

Unity Editor Version

2018.3.7f1

Mixed Reality Toolkit Release Version

mrtk_development

Alexees avatar Mar 07 '19 13:03 Alexees

@StephenHodgson can you take a look at this?

This problem goes as follows:

  • MRKT Update: updates activeSystems, FocusProvider in particular, which does the Raycasting for the pointers, hence saving world position results
  • MRKT Update: updates registeredServices, including the InputSystem which performs teleportation/ rotation, hence altering the MixedRealityPlayspace
  • BaseCursor Update: updates the cursor position

It does not matter if the BaseCursor updates before the MRKT Update (race condition), it will use an outdated Raycast result and therefore lerps back to its initial position before the rotation happened, only to smoothly rotate toward the new position from there.

This is just the visual issue of this, but could very well lead to problems when the raycast result does not match the user orientation during that frame.

Solution: teleporting must happen before raycasting is performed, but I don't see how this could be easily achieved since teleporting happens during the input phase of the controllers, which is also when you probably want to do something with the raycastresults...

Alexees avatar Mar 13 '19 10:03 Alexees

@Alexees , I couldn't repro this. I tried adding a plane with the DefaultButton material to the HandInteractionExamples scene and running that in a WMR headset and I see no gaze cursor. I was using v2.0.0-RC1. Am I missing something? Can you add step by step instructions for reproing or a scene setup for it?

luis-valverde-ms avatar Apr 08 '19 10:04 luis-valverde-ms

@luis-valverde-ms yeah, at one point I started seeing a lot of these "one frame late" issues and my reports got mixed up. This one is fixes with #3627

Alexees avatar Apr 08 '19 14:04 Alexees