XRTK / com.xrtk.core

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

When Teleporting the MixedRealityPlayspace is positioned to ground level #28

Closed hridpath closed 5 years ago

hridpath commented 5 years ago

Describe the bug Upon first teleporting, the viewer(camera) is placed at the position of the Teleport Target. This places the viewer at ground level.

To Reproduce Steps to reproduce the behavior: Create a terrain with textures. Set the Playspace/Camera at 0,0,0 position Adjust terrain to a -2 Y so that the player is positioned correctly upon start. Using the WHMD Motion Contorller, move the thumb stick forward to produce the Teleport parabola curve. manipulate the teleprot cursor to a position and release thumbstick.

Expected behavior I expect that the player will be teleported to that XZ position but add the cursor Y value to the Player Y value.

Information(please complete the following information):

Additional context Terrain is a procedural terrain created via GAIA.

hridpath commented 5 years ago

Debugging shows that the HotSpot for the TeleportEventData is null. This caused the code to default to the teleport cursor postition and the camera Y is set to the cursor position. Debug Break at XRTK/Services/TeleportSytem/MixedRealityTeleportSystem.cs line 229

hridpath commented 5 years ago

What is the HotSpot definition and why does it return null?

SimonDarksideJ commented 5 years ago

@StephenHodgson any comment?

StephenHodgson commented 5 years ago

The hotspot is supposed to be the place the user will end up no matter where they're pointing, but the pointer hits the object.

(Think of the way a user will be positioned directly in front of a card in the windows portal)

StephenHodgson commented 5 years ago

I'll try take a look at this at some point, but I'm a bit busy as of late.

hridpath commented 5 years ago

@StephenHodgson

  1. Why would the HotSpot be null?
  2. When is the HotSpot created/updated during the Teleport workflow?
hridpath commented 5 years ago

FYI... I have been able to work around this issue by setting the MainCamera's postion.y to 1.75. It was set to zero as well as the PlaySpace. I had seen in documentation or video that the Splayspace and camer be set to zero and that the terrain should be lowered to the appropriate postion.y.

However, the HotSpot remains null.

StephenHodgson commented 5 years ago

The HotSpot will likely remain null, unless you a a teleport handler into the scene. It's not needed for what I think you're trying to accomplish though.

The HotSpot is like an override for the final teleport location.

hridpath commented 5 years ago

At this time I will use the Main Camera Y positioning to continue. Closing this issue