Jump to content

VR position and Rotation


GSFC_1
 Share

Go to solution Solved by Josh,

Recommended Posts

Hey LW crew, i am trying to create the effect of flying from one place to another, and allow myself to create interfaces based on which direction i am looking. So, if I am looking east, and I hit the menu button, I want the menu to pop up in front of my east viewing vector, not some arbitrary Global "+Z" . 

 

How can I find the Location and rotation of my VR headset? 

I have found GetControllermodel, and I can locate the VR Controller, but i cannot find an API that will allow me access to the VR headset pos/rot, the only other thing I can think of is to use the actual Camera that is in my scene, but does LW actually use the camera as the VR controller?

Link to comment
Share on other sites

  • Solution

I believe the headset position and orientation will be given by any camera in the scene, since this is set to your headset orientation when the world is rendered.

You can use VR:SetOffset() to set an offset from the real world and the virtual world.  This is how I have implemented a teleport mechanic.

Note the latest commands are only available on the beta branch on Steam, and will not be 100% official until 4.5 is released December 22.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...