Tracking Head and Body
All,
I have head tracking working in a Unity project of mine. I've been thinking of using the hydra (Teddy's scripts, or something else) for body tracking, and it made me realize there's a little problem there to solve.
In my project, the OVRCameraController is the child of the PlayerController. The PlayerController handles turning of the body/feet and the OVRCC handles rotation of the view/head as some degree offset of the player body.
Without body tracking, the player's real body is always facing the keyboard/hydra receiver, and the head is +/- degrees off of that vector. Easy enough. The player's virtual body is turned via the controller/mouse/whatever, but their real body is homed to the keyboard, so we always know what forward is. If the head is looking 20 degrees to the right (of the keyboard), and the virtual body - whatever the rotation of the body now is, the head is still 20 degrees to the right.
However, if we use a body tracker, then the rotation of the head needs to be relative to the body rotation and no longer the keyboard. If I turn my head 20 degrees to the right, and then turn my body to match that vector, but without turning my view... then my body has rotated 20 degrees and what's actually happened is that I've rotated my head 20 degrees to the left. But the rift tracker wouldn't pick that up. Since I haven't moved my head in 3D space (just the relationship betwixt my head and my body) the rift tracker still assumes I've turned my head 20 degrees off of the player vector, which is also 20 degrees to the right, putting my head at 40 degrees to the right.
All of that to say that we can't use the raw tracking from OVR anymore. We need to subtract the body tracking vector from the head tracking vector if it's going to make any sense.
Has anyone taken a stab at all of this? I haven't messed with Teddy's scripts yet, but perhaps he already solved that. Where is that guy, anyways.
I have head tracking working in a Unity project of mine. I've been thinking of using the hydra (Teddy's scripts, or something else) for body tracking, and it made me realize there's a little problem there to solve.
In my project, the OVRCameraController is the child of the PlayerController. The PlayerController handles turning of the body/feet and the OVRCC handles rotation of the view/head as some degree offset of the player body.
Without body tracking, the player's real body is always facing the keyboard/hydra receiver, and the head is +/- degrees off of that vector. Easy enough. The player's virtual body is turned via the controller/mouse/whatever, but their real body is homed to the keyboard, so we always know what forward is. If the head is looking 20 degrees to the right (of the keyboard), and the virtual body - whatever the rotation of the body now is, the head is still 20 degrees to the right.
However, if we use a body tracker, then the rotation of the head needs to be relative to the body rotation and no longer the keyboard. If I turn my head 20 degrees to the right, and then turn my body to match that vector, but without turning my view... then my body has rotated 20 degrees and what's actually happened is that I've rotated my head 20 degrees to the left. But the rift tracker wouldn't pick that up. Since I haven't moved my head in 3D space (just the relationship betwixt my head and my body) the rift tracker still assumes I've turned my head 20 degrees off of the player vector, which is also 20 degrees to the right, putting my head at 40 degrees to the right.
All of that to say that we can't use the raw tracking from OVR anymore. We need to subtract the body tracking vector from the head tracking vector if it's going to make any sense.
Has anyone taken a stab at all of this? I haven't messed with Teddy's scripts yet, but perhaps he already solved that. Where is that guy, anyways.
