The main offset is applied in the /openVR/openVRHMD/OpenVRHMDExt module. This is the python extension attached to the HDM component....
From the help it says...
The HMD (eyes) are offset from the root transform depending on where you are standing in the safe room. This inverts that offset and puts it into the root pretransform - just working with tx tz for now.
As you can see I wasn't sure what to do about Y but you have complete control of where you end up after getting to the position you click in world space using this function. Currently this function applies an offset so that you end up standing on the spot you click in world space instead of the VR safe room center.
- Code: Select all
The HMD (eyes) are offset from the root transform depending on where you
are standing in the safe room. This inverts that offset and puts it
into the root pretransform - just working with tx tz for now.
es, er, et = self.eyeComp.worldTransform.decompose()
eyeP = tdu.Vector(et)
trigM = self.transformRigComp.worldTransform
trigs, trigr, trigt = trigM.decompose()
trigP = tdu.Vector(trigt)
rs, rr, rt = self.rootComp.worldTransform.decompose()
rootP = tdu.Vector(rt)
diffEyeRigP = eyeP-trigP
height = diffEyeRigP
heightP = tdu.Vector(0,height,0)
diffRootRig = rootP-trigP
offsetP = ((trigP - eyeP) + heightP) + diffRootRig
offsetM = tdu.Matrix()
I added a Height Offset parameter to the openVRHMD component. In this case you will only get the effect of the new height after your next teleport. Let me know if that works ok for you.
Another idea might be to add an elevator mode to the camera dolly that allows for you to set an offset Y so that you can smoothly modify your Y position while walking around and teleporting. That would require a second Y translation to be subtracted before the Offset function is run, and then added back after. Sounds like a good idea actually... I will put that on RFE list but not sure when I can get to it. I encourage others to try to make the cameraDolly / openVRHMD system better though. All the code for each is found in the respective extension module for each component.
Here is version 4...https://www.dropbox.com/pri/get/ViveDev ... iOH7jt8sQw
or try...https://drive.google.com/file/d/0B9u7wA ... sp=sharing