Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Teth's avatar
Teth
Honored Guest
10 years ago

[unity5] Editing OVRCameraRig

Hi,

I’ve got a problem since I updated my project to unity 5 with 0.8.0.0b runtimes and 0.1.3.0-beta integration for unity.

For my project, I need to change how the headset is tracked in space. So I made some modifications to the OVRCameraRig script to change the behavior of the tracking. (I added some code in the UpdateAnchors() function to modify the localpositions of centerEyeAnchor, leftEyeAnchor and rightEyeAnchor.)

It worked well on unity 4.5 with v0.6.0.0 unity integration, but since we updated to 0.8.0.0 and unity 5 and the new beta integration, with the same modifications to the new OVRCameraRig, our code doesn’t affect the centerEyeAnchor anymore, but it still affect leftEyeAnchor and rightEyeAnchor (We can see it in the editor).

So when I build my program, it’s like my modification isn't even here.

Thanks for help.

2 Replies

Replies have been turned off for this discussion
  • "Teth" wrote:
    I need to change how the headset is tracked in space.
    How do you need to change it? Are you using some other tracking system or is there some special behavior you're trying to achieve?

    Unity 5 updates the local pose of the center eye camera (or any Camera with targetTexture == null) natively before Update. You can't easily set the local pose after that, but you can set the pose of a parent GameObject to cancel it out so that the world pose is whatever you need it to be. Please see viewtopic.php?t=29065 for more discussion and pointers to an example of doing this in our Utilities.
  • Teth's avatar
    Teth
    Honored Guest
    I just need to change the tracking behavior, according to the oculus tracker values

    "vrdaveb" wrote:
    you can set the pose of a parent GameObject to cancel it out so that the world pose is whatever you need it to be.


    Of course, thank you very much. I don't know why I was obsessed with centerEyeAnchor.
    Sorry to have bothered you.