PatHightree / SpaceNavigator

SpaceNavigator driver for Unity3D
MIT License
170 stars 55 forks source link

Having Space Navigator in project breaks middle click to focus in SceneView #41

Open hybridherbst opened 2 years ago

hybridherbst commented 2 years ago

Describe the bug Having Space Navigator in project breaks middle click to focus in SceneView. Usually middle click will move the view and re-center on the clicked point. With this active, middle click does something but doesn't recenter the view.

To Reproduce Steps to reproduce the behavior:

  1. Create a scene
  2. Make two cubes with a bit of distance
  3. Middle-click one cube, note camera doesn't recenter
  4. Middle-click the other cube, note camera doesn't recenter
  5. Open ViewportController.cs
  6. in the static ViewportController() constructor, add return; as first line
  7. Repeat the test above
  8. Note that the camera properly recenters

Expected behavior Scene View behaviour is unaffected by package

Details (please complete the following information):

Edit: Might have the same reason as the drift seen (#29), since it seems that the comparison for == Vector3.zero fails since the inputs are actually never fully zero (this is in idle state): image A better way to react to input would be to actually listen for the InputAction.performed event instead of polling every frame and not knowing if data has actually changed.

PatHightree commented 2 years ago

Good find, apparently there's some camera positioning data being cached in the driver somewhere. Had a quick look but didn't see anything obvious.