XRTK / com.xrtk.core

The Official Mixed Reality Framework for Unity
https://xrtk.io
MIT License
309 stars 34 forks source link

Teleporting does not land on desired landing location #504

Closed SimonDarksideJ closed 3 years ago

SimonDarksideJ commented 4 years ago

XRTK - Mixed Reality Toolkit Bug Report

Describe the bug

Currently, when a user teleports to a location, their landing spot is not where they selected, for example

image

  1. User in left area selects a teleport location
  2. User lands in a space "relative" to where they selected, as shown on right (different based on teleport direction)

GIF of this happening in the editor Development-TeleportationBroken-2

To Reproduce

  1. Create project and configure
  2. Add floor to teleport on
  3. Teleport to an obvious location, e.g. Corner
  4. Observe landing location

Additional replication

  1. Create project and configure
  2. Add floor to teleport on
  3. Add a new plane, size to a small square and apply a red material
  4. Add "Teleport Hostspot" SDK component
  5. Teleport to HotSpot
  6. Observe landing location

Expected behavior

Teleport should land where they selected

Additional notes

Teleport system is a mess :D and needs an overhaul. Could not assign the teleport activity to a button. Post 0.2 change to teleport system.

StephenHodgson commented 4 years ago

What platform were you testing this out on?

SimonDarksideJ commented 4 years ago

ALL of them. Primarily WMR, Oculus and OpenVR

StephenHodgson commented 4 years ago

Works correctly on WMR && Lumin last I checked. I wonder if it's updating the position even though you've let go and continued to move your hand?

StephenHodgson commented 4 years ago

I did make some changes in #517 to the Teleport system to ensure we're at least using the correct height

SimonDarksideJ commented 4 years ago

There is a possibility that the movement is picking up / changing based on the letting go of the thumbstick, but no matter how careful I am, it does. Might try changing the teleport action to a button to verify.

But ultimately, this shouldn't happen, the place the pointer is when you let go should be the location you land.

StephenHodgson commented 4 years ago

Yeah I think some verification tests should do the trick.

I was thinking about putting a small sphere in the place the user lets go and the pointer position recorded. Then once the teleport is finished looking down to see how close you came.

SimonDarksideJ commented 4 years ago

As you can see in the video, sometimes quite far away, orientation seems to matter and direction. The landing offset does seem exponential

StephenHodgson commented 4 years ago

One possibility is that we're using the wrong frame of reference to do our calculations from.

Maybe using a world space position instead of a local one or vice versa?

StephenHodgson commented 4 years ago

I bet it's this line:

cameraParent.RotateAround(cameraPosition, Vector3.up, targetRotation.y - cameraTransform.eulerAngles.y);
SimonDarksideJ commented 4 years ago

In most cases, I'm not rotating when I teleport to replicate the issue. But I'm firing up to test with the Camera system PR Surely the "target" should be where the raycast collides with the surface?

SimonDarksideJ commented 4 years ago

Updated the issue log @StephenHodgson , used a hotspot as the target and differentiation is clearer.

User should at least land in the hotspot zone, but no. make sure you test from different angles

FejZa commented 3 years ago

I am picking this up