Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Need to disable movement completely

virtualroadsidevirtualroadside Posts: 5
edited December 2015 in Unity Development
Here's what we're trying to do:

We've mounted a physical camera device on the oculus, and we just want to show the output of the camera on a texture on the scene, and overlay various indicators/whatever on the scene. So we've got that working nicely, but the camera rig keeps changing its position when the user moves their head -- which is definitely not what we want (since it's showing the outside camera output... don't need it).

Basically, we don't want it to be a VR headset right now, just want the oculus to be a nice passthrough display.

Using unity pro and the latest sdk... 0.4.3 I think?

I've seen previous suggestions to disable the UpdateAnchors() function, but that just makes the game view shake a LOT. Using the various options on the rig doesn't seem to make any difference either (disable position tracking, etc). Any thoughts on how to do this?
«13

Comments

  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Are you trying to disable just position or both position and orientation?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • I would like to disable both.

    The camera in the scene should stay completely stationary, and only look in the direction that it was originally placed.
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    OK, so open OVRCameraRig.cs and add this near the top of the class definition (around line 59):
    public bool disableTracking = false;
    

    Then at the beginning of UpdateAnchors() (around line 102) add:
    if(disableTracking) return;
    

    Now, in the Unity inspector, click the disable tracking check box on the OVRCameraRig. You will also need to uncheck time warp in the OVRManager component on the OVRCameraRig.



    Hope that helps.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • andrewtekandrewtek Posts: 971
    Art3mis
    edited February 2015
    Off Topic, but when did the attachment feature start working?
    If it was just enabled... thanks!
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    The attachment thing was fixed maybe a month ago.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • Thanks for the response. I don't have the oculus with me now, but I'll try it the next time I'm near it.

    However, I definitely *did* comment out UpdateAnchors, and it didn't seem to fix the problem (I had the jitter problem instead). But I tried a lot of things, and it's possible that I had tried it without disabling TimeWarp/etc.
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Yes, you have to disable timewarp to avoid the jumpiness when you don't have tracking enabled.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • Sorry for the delay, but this fixed the problem. Thanks so much!
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Great!
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    Doing this freezes a shot of the scene, but still allows for head tracking.

    It creates a "Movie screen" like effect, where you can still look around a black world, but your screen is frozen.

    I (and i believe the OP) want to disable tracking whereas you cannot look around at all. How is this done?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    You have to also disable time-warp, as I have mentioned.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    I have, both instances of it... Still shows this movie screen like effect.

    Do you have some example code?
    Trying to attach my stuff but i dont know how to on this forum...

    Both Time warp and Freeze time warp are unchecked, and position tracking is checked.

    Then, in my camera rig i have...
    #if !UNITY_ANDROID || UNITY_EDITOR
    	private void LateUpdate()
    #else
    	private void Update()
    #endif
    	{
    		EnsureGameObjectIntegrity();
    		
    		if (!Application.isPlaying)
    			return;
    
    		UpdateCameras();
    
    		if(trackingEnabled) {
    
    			UpdateAnchors();
    		}
    	}
    
    #endregion
    

    Any guesses?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    I just tried again with my instructions, and they work fine with Unity 5.0.1f1 and Oculus 0.5.0.1 (confusing numbers I know!). The issue is almost surely that time-warp is still enabled.

    Please follow these steps exactly:

    viewtopic.php?f=37&t=19863#p242262
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    I can email you a picture of my OVRManager script... its
    [x] Use position Tracking
    [] Time warp
    [] Freeze time warp
    [x] Reset tracker on Load
    [] Monoscopic
    [] Hdr

    I'm on Unity 4.6.2f1, and i'm not sure how to check the oculus version - but i downloaded it about a week and a half ago so i doubt its out dated. Where can i check the version?

    I wonder if i'm portraying what the end result is correctly - Basically when I disable the UpdateAnchors(), it essentially takes a screenshot of what the Head mounted display is looking at - so if you don't move your head, basically i have my desired effect. However, if the user then looks around, this screenshot stays put and locked, but its "movie screened" in a black world, and the user can look wherever, even behind them (and the "Screenshot" is off the screen entirely.

    Have you seen this before? Do you have some sort of sample simple project so I can test something that you see working?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Yes, I've seen this exactly before. It happens when you disable tracking but have time-warp enabled.

    I just ask that you follow the instructions I posted exactly (look at the code and the screenshot).
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    Yes, I've seen this exactly before. It happens when you disable tracking but have time-warp enabled.

    I just ask that you follow the instructions I posted exactly (look at the code and the screenshot).

    Have followed your instructions EXACTLY, even with the same code and variable names. Still does this "window" with a stale world, while tracking the head movements.

    This even happens when I tie the "trackingEnabled" to false on scene load (and not have it based on a button toggle). Like in the script parameters.

    I'm so at a loss here. This seems like something that should be simple. What could I be missing? Do you have a simple unity file with an example you could send me? or maybe post your entire OVRCameraRig?
  • wallawockowallawocko Posts: 24
    Brain Burst
    edited April 2015
    Hmm, Just thinking through this...

    I think the issue on my application is is that i'm trying to do this as a "toggle", so the scene allowing for the tracking of the HMD initially, and then disabling it on a button press.

    However, this means that the scene initially runs through "UpdateAnchors()" several times (particularly, at startup, in the Start() method, and does not just return;). Is this what attaches the camera to the Head Mounted Display (HMD)? It seems so. If so, how would I enable this "toggle" functionality? Is there any way to essentially reset the camera to be stuck where the user is currently looking?

    So sad this doesnt seem to be working. No matter what I try, i get this movie screen effect. I've even changed the above now to be set through the unity editor ("Checking Disable Tracking"), and it still movie screens on me. Could it be because I have several other scenes that use this OVRCameraRig script, and have probably already run through this UpdateAnchors() method before?

    **Edit** - I've even made a brand new application. Nothing in it but 1 scene which has a cube, and the OVRCameraRig prefab. Edited everything the way you said, and i still get the "Screen" effect. Help! Could this be because i'm deploying to an android device? The Samsung Gear VR. But I don't see how that would be an issue...
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    I don't think the toggling would mess anything up, as I have done this just checking the box I created while the game was playing and it worked fine.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    Still trying to debug this....

    If i amend my OVRCameraRig to be:
    if (disableTracking) {
    			OVRManager.display.RecenterPose();
    			return;
    		}
    

    Then it gives me the desired effect (The scene freezing and essentially just being a monitor in front of you) and disables looking side to side, but it still has this "movie theater" effect for looking up and down.

    Cyber, could you maybe email me a simple unity project that you are enabling/disabling this on? I just can't understand whats missing here...
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    Yeah, sure. I can send you a project. Not sure why my instructions aren't working for you.

    The files are on my work computer, but I can check tomorrow.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    Thank you!! Eager to figure out why this is acting differently for us!
  • What if I want the oculus movement to be disables completely, and make any position and orientation only affected by the OVR object and the OVR object's parent? But not in a way that freezes the screen in place, and you can look to a black space around the screen. (like in the desktop oculus app) I want to make the oculus as if it didn't have any motion sensors at all.
  • wallawockowallawocko Posts: 24
    Brain Burst
    I think what you're looking for is very similar to my desires as well.
  • I wasn't sure. I was trying to mess with the script before I even saw this thread, and tried exactly the same things they advised, but the result was the screen froze in one location and the user could look at it as a 2D image, floating in a black space. The same thing goes for what was going on behind. I think we need to find the piece of code that extracts the sensor data from the Oculus and just disable those lines of code. Am I right?
  • WOOPSYDAISY disabled time warp and it worked just fine :P
  • wallawockowallawocko Posts: 24
    Brain Burst
    WOOPSYDAISY disabled time warp and it worked just fine :P

    Is my timewarp just not disabling properly?

    Ugh! TrollAxe, any chance you could send me a simple project that has this functionality working, so that I can test it on my setup?

    I've followed the instructions here EXACTLY multiple times, each to no success. Every time I get this "Movie Screen" effect.
  • wallawockowallawocko Posts: 24
    Brain Burst
    I'm updating Unity to version 4.6.4 (from 4.6.2), we'll see if that changes anything... Any other ideas?
  • cyberealitycybereality Posts: 26,156 Oculus Staff
    I am using Unity 4.6.4f1. I just created a new project, imported the 0.5.0.1 Unity PC integration and did the code changes as listed earlier in this thread. It works fine for me.

    I have attached the whole project folder for you to test with. Hope that helps.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
    Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
  • wallawockowallawocko Posts: 24
    Brain Burst
    Ahh!

    I believe this is the issue, as I have to use the Oculus Mobile SDK - If i try to Build and Run your project on my Android phone, it doesn't compile.

    Looks like the issue may be in the Mobile SDK then?
  • wallawockowallawocko Posts: 24
    Brain Burst
    All signs seem to be pointing to the Mobile SDK... Troll is using the Rift (PC integration not Mobile SDK) as well. What could be different between the two deployments?
Sign In or Register to comment.