Oculus VRC with Unity - unity3d

I'm developping a game with Unity.
I'm trying to check all of the VRC (Virtual Reality Check) tests, especially TestResponseToRecenterRequest and TestAppShouldQuit ( link ).
My problem is, I have absolutly no idea how to listen these requests.
Most of forums said to use ovr_GetSessionStatus. However, it's a C++ method, not a C# one. Can you point me to a valid solution to listen ovr status or, at least, handle recenter and quit requests ?
Cordially

Probably you already fixed this, but i found that the ovr_GetSessionStatus is exposed as static variables on the OVRPlugin class, so you can check on an Update().
if (OVRPlugin.shouldRecenter)
{
OVRManager.display.RecenterPose();
}

Related

Unity3d Steamworks is not initialized

I am doing a unity project for Steam. So I downloaded and added SteamWorks.net to the project created an empty object and attached the steam manager code to that. And for the achievements, in the script, import steam using
'using Steamworks;'
And set achievements using
SteamUserStats.SetAchievement();
SteamUserStats.StoreStats();
Now when I run the code I am getting an error
'Steamworks is not initialized".
how to fix this
When testing make sure the steam_appid.txt is in the folder. SteamManager monobehaviour will initialize API on awake.
Also this worked for me and I felt kind of dumb but it's important. Double check to make sure your steam app is currently logged in. If your turned on your computer and it logged you out or if there was an update or something that requires you to log in than it wont work and it'll throw that error. Otherwise you should be good if you listened to the other answer as well.

Problems getting OSVR to initialise the HMD Display with Oculus DK2

I am using a Oculus DK2 (v0.8) and OSVR SDK. I'm having a problem getting the HMD to run/display anything.
The Oculus samples and the OSVR samples do work however, so the osvr_server seems to run fine.
My application itself renders a test scene just fine when not using a HMD.
I tried two approaches:
First, just creating a osvr context and creating a DisplayConfig object. This seems to work, but DisplayConfig::checkStartup() fails (I do this in a loop, calling update on the context when the checkStartup call is failing). I used the OpenGLSample.cpp as a guide for this
Second, I tried using a RenderManager, but the call to createRenderManager results in a crash within the RenderManager.dll. I get the same crash wether I create the graphics lib object myself or if I let the library create it.
I am quite stuck now, since the demos and examples do work, I have no idea where to look for the error on my side. Creating the context works, querying interfaces as well, but the crash with createRenderManager is beyond me.
Does anyone have any hints or ideas what the problem could possibly be?
Regards and thanks in advance
pettersson
RenderManager should not crash during open. There have been a couple of bug fixes recently to avoid that happening, and the latest RenderManager binaries, libraries and header files are available with the SDK download from http://osvr.github.io/using/ along with updated copies of the example programs.
When something goes wrong in RenderManager, it usually reports that to standard error. We're moving that to a logging interface, but for now it should show up on the console. Posting an output of that as an issue at https://github.com/sensics/OSVR-RenderManager/issues is a good way to let the developers know that there is a problem. Of course, providing the same sort of information you provided here will be helpful as well.

How to find out if Unity plugin hangs (from unityscript)

Unity player on my page hangs sometimes. Is it possible to detect it from unityscript (polling method is acceptable) and react to that- for example reload page?
a colleague ran into this issue, I believe that after an extend research with no good results he came up with this solution:
In the web page declare a global variable stillAlive for example.
Use setInterval to check for that variable every n second, something like this:
if (stillAlive){
stillAlive = false;
}else{
//do things
}
Make an Application.ExternalEval call in your application every n/2 seconds, something like this
Application.ExternalEval ("stillAlive=true;");
I don't know the exact details, but he did something to sync those. I'm sure you can figure something out along this idea.
Note: For some reason I couldn't format the code in this answer, so if someone can fix it, please do.
Update: I've just asked him, he said he "synced" them by initiating the setInterval() with Application.ExternalEval().

Flash Player 9 vs Flash Player 10 with FLEX 3, ?_method=PUT/DELETE not working?

I have a FLEX 3 frontend that worked fine in FlashPlayer 9. But now that I've upgraded to FlashPlayer10, the ?_method=PUT/DELETE hack is not working anymore. All those requests show up as a POST on the backend now. I did some reading and it sounds like I need to use as3httpclientlib AND run a socket policy server to give access to port 80 (or any other port) in order to use as3httpclientlib. So my question is: are you freakin kidding me? How is it that, in earlier versions of Flex/flash player, all I had to do was add a simple string ("_method=") to the url. But now I have to do the hokey pokey AND turn my self around? Really? Please someone tell me that I've got this all wrong, and that _method= is, in fact, still supported. Otherwise, its BYE BYE FLEX/FLASH PLAYER - NEVER AGAIN!
I understand you very much, my friend, just had similar noise with authentication headers in new one Security Policy from Adobe. Anyway, if you'll share your code, maybe I could help you, because your goal is not clearly explained in your post, Buddy. So let me know please, cause java sandbox and silverlight are not the better way in this case. But maybe some javascript stuff could save our time.

SDL.NET (VB/C#): What should the startup object and application type be?

I eventually couldn't get any further with my program due to the various shortcomings of VB.NET (bad audio support, no reading events in the middle of execution, very weak keyboard input, etc). So I tried SDL.NET 6.1.
Despite its terrible documentation, I was able to fix my code to use it and I love it!
But there's a problem. I don't know how to set up my application settings for it. The Startup Object definitely should be a class (the examples always are in classes, never modules), but a startup class specifically has to be a form! This is bad because SDL makes its own window via SetVideoMode; you don't need a form. So when the form constructor New() finishes, a useless form is created and you have two windows.
I tried placing a call to the game engine loop within New() so that the game starts up without New() ever finishing. The game runs normally, and this solves the "second window" problem... but it can't be closed! X button does nothing, calls to Events.QuitApplication or Me.Close are blatantly ignored, etc.
I'm stumped. It seems I need to set a non-form class as the startup object, but it won't let me.
Oh, by the way, it seems that there are two things called "SDL NET". To clarify, I'm using this one, which exists in the SdlDotNet namespace.
Oh, I forgot to mention, I also noticed that a lot of the examples have a line that says "[STAThread]". Is this is important?
EDIT:
I've already received and accepted an answer for my question, but I want to tell other people what the problem is with exiting/closing the app, even though that wasn't my question:
While SDL.NET allows you to receive input and run other events without having to stop running logic, the application still cannot quit while logic is being run. So I find the best way to tell your SDL.NET application to Quit in the middle of running logic is to use the following TWO lines:
SdlDotNet.Core.Events.QuitApplication
End
Place these in the handler for the SdlDotNet.Core.Events.Quit event, as well as anywhere else you want your program to quit.
The Startup Object definitely should be a class (the examples always are in classes, never modules)
Here's your mistake. There's no real difference between a class and a VB module from CLR perspective. So just make it a module with Main and go on. There is no need for a class. I suspect you're looking at C# examples, which use classes - but that's because there is no such thing as a module in C#.
[STAThread] probably won't make any difference for SDL. It is important for UI applications (both WinForms and WPF require it), but I don't think that SDL does any COM calls, so it shouldn't care whether your thread is STA or not. It's just something that Visual Studio puts on Main in new projects by default.