Coder Social home page Coder Social logo

osvr-unity's Introduction

OSVR-Unity

Join the chat at https://gitter.im/OSVR/OSVR-Unity

Maintained at https://github.com/OSVR/OSVR-Unity

For details, see http://osvr.github.io

For support, see http://support.osvr.com

.NET Binding for OSVR - "Managed-OSVR"

The Unity integration is based on the Managed-OSVR .NET binding for OSVR, which is maintained in a separate repository. That code is entirely Unity-independent so it can be used in other applications/frameworks.

OSVR-RenderManager Support

OSVR-Unity uses the OSVR-RenderManager library for direct-mode rendering, lens correction, timewarp, etc.. OSVR-RenderManager is a separate, Unity-independent project that is used in other applications/engines. The project which bridges between OSVR-Unity and OSVR-RenderManger is OSVR-Unity-Rendering, which uses the Unity low-level native plugin interface.

These libraries are copied over to the Plugins directory in our CI build, and are not included in the source.

OSVR Unity Integration

Step-by-step getting started guide

Getting Started Video Tutorial

The development "project" for Unity is in the OSVR-Unity directory. We are currently maintaining support for 4.6.1 as well as 5.x in the same tree, so be aware of that if you're using a newer version that you don't break the older version. (You can parallel-install different versions of Unity, you just need to specify a different install directory). This is the project used to generate the .unitypackage file (there is an editor script that does it for the CI's sake).

The OSVR-Unity directory contains its own README with some basic documentation that is shipped with the built version, as well as a CHANGES file (also shipped with builds) that should be updated when changes that affect consumers of this project (users of the plugin) are made.

Note that if you're looking at the source OSVR-Unity project and not an imported unitypackage, you'll need to download and import the Managed-OSVR and OSVR-RenderManager project artifacts. The quickest way to obtain the necessary dlls may be to download and import the Plugins folder(s) from the latest binary snapshot. If you're building Managed-OSVR from source as well, see below.

Development Information

When the build-for-unity.cmd script in Managed-OSVR is run (by the CI or a human), it generates a tree with Managed-OSVR-Unity as the root directory.

install-managed-osvr.cmd can put those files in the right spot if you place the Managed-OSVR-Unity in the root of this repository first. Otherwise, the contents of that (which will be a .dll, and some additional subdirectories and files) should be moved to the OSVR-Unity/Assets/Plugins directory.

OSVR-Unity

This contains the source project used to generate .unitypackage files, since that seems more useful as "source" than a repo containing a .unitypackage file. Any one of the scenes should work to get you in there. There is an editor script to automate the bundling of a .unitypackage for the sake of CI.

Other files

  • install-managed-osvr.cmd - A script to copy the output of a Managed-OSVR build to the right spot in the current repo, given that you place the Managed-OSVR-Unity directory (produced by the build-for-unity.cmd script over in Managed-OSVR) in the root of this repository first.
  • prep-package.cmd - Used by CI to create a directory that will eventually be packed as a snapshot, format the Unity readme and other markdown files as HTML, and copy files into the snapshot directory as well as the OSVR-Unity directory. Not used in the course of normal development.
  • build-unity-packages.cmd - Used by CI (but potentially others as well) to invoke the Unity editor script that packs the Unity plugin into a .unitypackage file. Requires that the Managed-OSVR build already have been run to copy over the .NET assembly and native DLLs into the right place in the tree. It copies that .unitypackage file into the distribution directory made by prep-package.cmd if that directory exists.
  • unity-generate.lua - Generates some very repetitive code wrapping the raw C-style pinvoke callbacks in something more .NET-idiomatic. It can be run with any reasonably recent version of a Lua interpreter, and its output should be placed into OSVR-Unity/Assets/OSVRUnity/src/InterfaceCallbacks.cs in the designated area (see comments in that file)
  • third-party/discount-2.1.6-win32 - This contains binaries of a liberally-licensed Markdown-compatible file formatter, used by CI (specifically prep-package.cmd) to generate HTML documentation from the markdown files in OSVR-Unity.

Demonstration video

Video showing how to integrate OSVR into Unity project can be seen here: https://youtu.be/TtLn6XpEisw

License

This project: Licensed under the Apache License, Version 2.0.

osvr-unity's People

Contributors

chrisdenham avatar cobbchaserazer avatar demonixis avatar duff14 avatar gitter-badger avatar godbyk avatar imperialpenguin avatar jeromiya avatar nanospork avatar rpavlik avatar russell-taylor avatar stellatigre avatar vrguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osvr-unity's Issues

Move Managed-OSVR into its own repo

I'll be working on an OSVR-MonoGame when this goes fully open source. Please move the Managed-OSVR code into its own repo to facilitate this. Other community contributed ports/integration efforts would benefit as well.

I didn't see any at first glance, but if there is any unity-specific code in OSVR-MonoGame, please #ifdef it or preferably factor the code out into a partial class implementation or configurable helper class, per your choice. It would be helpful for me, not having any unity experience, to add some explanation into what the unity code is doing so I can determine whether it is even applicable to a MonoGame port.

I'll leave it up to you to determine the best way to get Managed-OSVR into OSVR-Unity, and I'll follow suit with OSVR-MonoGame. Perhaps checking in the binaries, or a git submodule, or a build/copy script, or symbolic links, or a pre-release NuGet package when this repo is fully public.

As an aside: I haven't had a lot of time to review the code, but from what I see so far there seems to be a fair amount of code in the Unity plugin that is not Unity specific. Perhaps some of that can be moved into the Managed-OSVR code instead?

Need automated test for scene-switching crash

Splitting this out from #52.

There used to be a crash related to scene switching, described better in that issue. I think an affected commit to test with would be 7483b05

We need a command-line-automatable test to make sure that doesn't happen again.

Unnecessary files in OSVR-unity.unitypackage?

There seems to be some unnecessary files being packaged, but maybe some of these are intentional?
Plugins/OSVR.ClientKit.pdb
Plugins/x86/README -- "placeholder for missing libs" although they are included in the package
Plugins/x86/README -- Readme for OSVR-Core. Readme for OSVR-Unity is included in OSVR-Unity/
Plugins/x86/NEWS -- for OSVR-Core
Plugins/x86/NOTICE -- for OSVR-Core
Plugins/x86/CONTRIBUTING-- for OSVR-Core. CONTRIBUTING for OSVR-Unity is already in OSVR-Unity/
Plugins/x86/LICENSE-- already included in OSVR-Unity/

These also appear in Plugins/x86_64/.

Also, OSVR-Unity/CHANGES is not included in OSVR-Unity.unitypackage

PositionInterface, OrientationInterface, and PoseInterface need optional transform update behavior

RequiresPositionInterface, RequiresOrientationInterface, and RequiresPoseInterface are convenient base classes for a behavior that requires one of those interface components in its own logic. However, those behaviors currently always update their parent game object's transform (position or rotation or both). This should be optional in case the dependent behavior wants to take over the transform modification. A true/false property that can be set in the editor (like the path), which disables the code that updates the parent object's position and orientation.

We may also want to expose something to RequiresFooInterface subclasses to enable/disable the update behavior programmatically instead of relying on the editor flag to be set a certain way.

Can't build a game with x86 and x64 libs (same name)

Hi,

I can't build my game with both x86 and x64 dlls of OSVR because Unity told me that a existing DLL is already present with the same name. The workaround is easy, I just remove the x64 folder. I think it can be a good idea to rename the x64 dll to be able to build a 32 and 64 bit build of the game.

demonixis.

Read display parameters from JSON file at runtime

Right now, JSON descriptor files need to be brought into prefab. Modify so that JSON file (display parameters such as FOV, overlap) are read at runtime, thus allowing to quickly change between displays.

VRSurfaces render twice when RenderManager is disabled

I've discovered a big problem when the RenderManager is not used. In the setup when the VRSurfaces are created, the cameras are disabled if the RenderManager is active, so as not to be drawn twice. The problem is that even if the RenderManager is disabled, VREye calls surface.render during it's update, then Unity draws the cameras. This increases the load on the GPU by 50% in my project. 4ms for the main camera and 1ms each for the surfaces. I can get the performance back with no noticeable side effects by either setting them to false when they are created regardless of whether RenderManager is used or by commenting out the surface.render call in VREye and letting Unity handle it. I'm not sure what the preferred method is, but in my project the framerate drops from around 80 to around 55 without the fix. So it's pretty important.

Set Application.targetFrameRate to display refresh rate

https://github.com/OSVR/OSVR-Unity/blob/master/OSVR-Unity/Assets/OSVRUnity/src/VRHead.cs#L199

Application.targetFrameRate should be set to the refresh rate of the display. I believe the plan is for this to be added to the display descriptor along with other properties necessary for rendering updates.

Might also want to consider setting Time.fixedDeltaTime to 1/Application.targetFramerate. Our default TimeManager.FixedTimestep is set to 0.016667 or 60Hz, but someone using a DK2 might want this set at 75Hz.

http://www.reddit.com/r/oculus/comments/2odahu/unity_developers_change_your_fixed_timestep_to/
http://docs.unity3d.com/Manual/TimeFrameManagement.html (fixed timestep section)

Reducing allocations/fix memory leak

We have a report that leaving a Unity game running for about 45 minutes causes an out of memory crash. Core applications have been left running a lot longer than that with no ill effects, so the issue is most likely in Managed-OSVR or OSVR-Unity.

From Radial-G OSVR 0.2.77 (so that might be the Unity build number or the core build number), the version of OSVR-Unity compiled in has this interesting disassembly (from ILSpy):

.method private hidebysig 
            instance void OnDestroy () cil managed 
        {
            // Method begins at RVA 0x98f70
            // Code size 40 (0x28)
            .maxstack 8

            IL_0000: ldstr "OnDestroy"
            IL_0005: call void [UnityEngine]UnityEngine.MonoBehaviour::print(object)
            IL_000a: ldarg.0
            IL_000b: call instance class OSVR.Unity.InterfaceCallbacks OSVR.Unity.InterfaceGameObject::get_osvrInterface()
            IL_0010: ldarg.0
            IL_0011: ldftn instance void OSVR.Unity.PoseInterface::callback(string, valuetype [UnityEngine]UnityEngine.Vector3, valuetype [UnityEngine]UnityEngine.Quaternion)
            IL_0017: newobj instance void OSVR.Unity.InterfaceCallbacks/PoseCallback::.ctor(object, native int)
            IL_001c: callvirt instance void OSVR.Unity.InterfaceCallbacks::RemoveCallback(class OSVR.Unity.InterfaceCallbacks/PoseCallback)
            IL_0021: ldarg.0
            IL_0022: call instance void OSVR.Unity.InterfaceGameObject::Stop()
            IL_0027: ret
        } // end of method PoseInterface::OnDestroy

So OnDestroy of a pose interface is allocating a pose callback then calling to unregister it. I'm thus a) not sure the underlying code does what I think it does and b) suspecting this probably isn't helping memory pressure, though creating/destroying pose interfaces is probably not common enough to be our leak.

`DLLSearchPathFixer` on non-Windows platforms

Not sure how Mono assemblies handle search paths to native shared libraries on non-Windows (handled already) and non-iOS (static linking mandated) platforms like Mac or Android, possibly something RPATH-like. If it can't be built into the library like RPATH can, we'll need a similar functionality as found in DLLSearchPathFixer.cs (whose behavior is directly inspired by as close as an official Unity statement as I could find on the matter) so that not just the directly p/invoke accessed shared libraries, but also their dependencies, can be loaded.

The alternative would be special monolithic (single native shared library) builds of OSVR ClientKit, which might be a bit of a pain to get into the build system but could make life easier.

See:

Apply code style

Right now code style is kind of hit and miss and inconsistent. Doesn't look like there were a ton of tools for this in C# besides having Visual Studio do it for you (surprisingly enough, given I figured it was easier to parse/lex/sema than C++), but the Roslyn .net core project apparently recently open source a tool that they're using to apply and enforce a code style, and it's probably worth looking into: https://github.com/dotnet/codeformatter

EyeTracker2D/3D, Direction, Location2D, and blink interface support

This is in progress. See:
master...JeroMiya:EyeTrackerInterfaces

Adapters, interface game objects, injection utilities, and prefabs are complete. Just working on a little tracking visualization. I've settled on adding an eye tracker axis in the trackerviewer scene. Eventually it would be nice to have some sample code for "picking" an item in a scene via eye tracking, though I don't necessarily want to encourage using eye tracking for, say, gun aiming as it would be physically exhausting for players. Object picking via eye tracking is beyond the scope of this issue, however.

Report an error message when dependent libraries can't be found

While the DLL search path fixer should keep this from happening, Managed-OSVR shouldn't silently fail if it can't load the DLLs it's trying to p/invoke, which is most difficult when it's a dependency of the invoked DLL that's missing.

On a related note, if the directly-invoked DLLs are missing (such as when trying to run a 64-bit Unity build when there's no 64-bit Unity plugin yet), that should also be a visible error condition.

Cross-platform build scripts

build-unity-packages.cmd and prep-package.cmd only work on Windows, of course, but there may be contributors running Linux or Mac. Cross-platform build scripts would be useful for these folks. As long as it doesn't involve installing cygwin/mingw or running in bash shell on windows.

Options might be things like build scripts written in JavaScript and run via node.

Or, since this is a .net repo, maybe a .net build script:
https://github.com/cake-build/cake
http://fsharp.github.io/FAKE/

Or just provide both .sh scripts for Mac/Linux and .cmd for windows, since the scripts are so small.

InterfaceAdapter implementations for Unity

Implement OSVR.ClientKit.InterfaceAdapter sub-classes for Unity and use them in the Unity specific wrappers in place of InterfaceCallbacks. Make appropriate changes to InterfaceGameObject and InterfaceBase to facilitate this, taking care to remain backward compatible where possible.

Research:

  • Can Unity handle a generic InterfaceGameObject and InterfaceBase implementation? This would be ideal to support typed interface wrappers for scripts, but we can work around it in several ways if not.

Potential breaking changes:

  • InterfaceGameObject or its subclasses would switch from InterfaceCallbacks to an IInterface implementation (either a unity adapter or the original OSVR.ClientKit ones, e.g. ButtonInterface which doesn't need a unity adapter).
  • If InterfaceGameObject and InterfaceBase can't be generic classes, then they may need to be made abstract, with concrete implementations specific to each interface type. This is more type safe, but existing InterfaceBase sub-classes will need to switch to a more specific type.

This is in-progress. The adapter implementations are done. I'm looking into the research item now, and planning the InterfaceGameObject/InterfaceBase refactor.

Investigate frame timing with v-sync enabled

Ideally we want to be updating our poses as late as possible before rendering (see http://docs.unity3d.com/Manual/ExecutionOrder.html). We're currently doing this in DisplayController::OnPreCull (https://github.com/OSVR/OSVR-Unity/blob/master/OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs#L212).

When examining some event traces with v-sync off, timing looks reasonable -- we get pose state just before rendering starts, with fresh tracker data arriving just before that.
image

With v-sync on, our updates look like they're happening at the wrong time. Here you can see the GetState calls are happening after rendering has already started.
image

Taking a look at the Unity profiler indicates that with v-sync on, a lot of time is spent waiting (WaitForTargetFPS). It would be helpful to know when this waiting occurs in execution order, and if it's possible to keep updating in the background while waiting. I have an open question on this: http://answers.unity3d.com/questions/1068128/when-does-waitfortargetfps-actually-wait-in-execut.html

Does anyone have insight into this v-sync problem or see some possible solutions?

More event traces: http://imgur.com/a/uQDed

Convert `PositionInterface` in OSVR-Unity to use `InterfaceBase`

Right now it directly interacts with the underlying managed-osvr library, while InterfaceBase (which facilitates usage of OSVR.Unity.InterfaceGameObject) takes care of that in a unified way.

The impediment here is that it will break some code, since the path will move from being on the PositionInterface itself to being on the InterfaceGameObject. (I don't personally know how to make an upgrade/migration automatic, but that doesn't mean it's not possible)

This issue should be considered to include all the existing Interface MonoBehaviours that haven't been ported yet - this may not be the only one.

ClientKit should use persistent singleton pattern

ClientKit.cs calls DontDestroyOnLoad() in it's Awake() function. If you load new scenes that also have a ClientKit prefab, then you have multiple ClientKits trying to communicate with the server, which is causing very high latency and throws NullReferenceExceptions in Interface Callbacks.

There should only be one ClientKit in the scene, and the persistent singleton pattern should enforce this: http://unitypatterns.com/singletons/ (page has been removed)

edit: the original link is gone but anyone still interested in the persistent singleton pattern can find a copy of the page here https://gist.github.com/Ashwinning/5a1d5858959af0396b04

Contributor license agreement needed?

I'm not sure when the ETA of the public release is, but in the meantime I'd like to submit some pull requests. Is there a contributor license agreement I can sign or text that I can copy into pull requests made before the public release?

Handle `size_t` length arguments properly in ClientKit wrapper.

Lines I'm talking about:

The corresponding C methods those invoke are here: https://github.com/OSVR/OSVR-Core/blob/master/inc/osvr/ClientKit/ParametersC.h

Note that those are actually size_t which is platform dependent, and which I think we can assume is the same as uint_ptr_t. size_t is the idiomatic type to use there from a C and C++ perspective, so if reasonable I'd like to leave those signatures alone. However, it poses an issue to the .NET bindings. It looks like there's a way to handle it properly. If it turns out to be unfeasible, we can change those to uint32_t if needed, since that should be a big enough type, but if a solution isn't too hard that's just in the .NET stuff I think that's probably preferred.

Here are the links I've collected related to this issue.

Separate compilation to an assembly of the OSVR Unity source

What it says - don't ship the whole OSVR-Unity source in the binary .unitypackage but rather build and ship a compiled assembly. A few reasons:

  • User changes in that code at an individual project level are not recommended - if you want to contribute, the source is the way - because in case of updating to a new version, those changes would get overwritten.
  • Would allow us to replace the assembly in already compiled Unity applications (I think?) to fix bugs, etc, just as we can do with the rest of ClientKit native and its deps.

Add Android libraries to the build

There's placeholders, but right now you have to manually put the files in there. We should be scripting this so that it comes in via the CI.

OSVR.Unity.InterfaceCallbacks.PoseCallback should take one value argument

Currently PoseCallback takes a position and a rotation:

public delegate void PoseCallback(string source, Vector3 position, Quaternion rotation);

In order to help support more generic callback code, a single 'value' type should be used for each report. In this case, since we have multiple values, a wrapper struct should be constructed:

public struct PoseReport
{
    Vector3 Position { get; set; }
    Quaternion Rotation { get; set; }
}

public delegate void PoseCallback(string source, PoseReport pose);

This allows, hypothetically, a common generic interface callback:

public delegate void InterfaceCallback<T>(string source, T value) where T : struct;

Use idiomatic .Net naming conventions and other best practices

Use this as a reference for naming conventions:
https://msdn.microsoft.com/en-us/library/ms229002(v=vs.110).aspx

Here are a few issues I found:

  • OSVR namespace should be Osvr.
  • InterfaceBase has two public readonly properties interfaceGameObject and osvrInterface. They should be named InterfaceGameObject and OsvrInterface.
  • InterfaceCallbacks has a public string field path. It should be a property and pascal cased.
  • InterfaceCallbacks callback delegates types should be declared outside the class.
  • ClientKit has a public string AppId. If possible, this should be a property (unless the unity editor requires it to be a field?)
  • ClientKit properties instance and context, readonly property should be pascal cased.
  • OSVRUnityBuild class should be named OsvrUnityBuild.
  • OSVRUnityBuild.build should be OsvrUnityBuild.Build
  • ColorChanger.materialID should be a property and named MaterialID
  • ColorItem fields name and color should be properties and named Name and Color.
  • ColorManager fields colors, changeDuration, changeDelayRandomMax, delay, and duration should be properties and pascal cased.
  • HandleButtonPress.handleButton should be HandleButton.
  • SampleAnalog.callback should be Callback.
  • SampleButtonScript.handleButton should be HandleButton.
  • DLLSearchPathFixer should be named DllSearchPathFixer.
  • DLLSearchPathFixer.fix should be Fix.
  • InterfaceGameObject.path should be a property and pascal cased.
  • InterfaceGameObject properties osvrInterface and interfaceGameObject should be pascal cased.
  • OrientationInterface.path should be a property and pascal cased.
  • OrientationInterface.callback should be pascal cased.
  • PoseInterface.callback should be Callback.
  • PositionInterface.path should be a property and pascal cased.
  • PositionInterface.callback should be Callback.
  • VREye fields eye and cachedTransform should be a property and pascal cased.
  • VRHead fields viewMode, stereoAmount, maxStereo should be properties and pascal cased, unless Unity requires them to be fields?
  • ClientContext consts/statics OSVR_CORE_DLL, OSVR_RETURN_SUCCESS, OSVR_RETURN_FAILURE should be OsvrCoreDll, OsvrReturnSuccess, and OsvrReturnFailure. Snake casing is not generally done in .Net code. Especially not all-caps snake casing. Everything should be either pascal cased or camel cased depending on the context.
  • ClientContext DllImport methods should be pascal cased. Use DllImport.EntryPoint to map these to their camel cased native methods.
  • ClientContext methods shutdown, update, getInterface, and getStringParameter should be pascal cased.
  • I'm not if the unity runtime has the same property getter/setter inlining as the regular .net framework, but if it does, then the client report structs (PositionReport, OrientationReport, etc...) should be using pascal cased properties, not public fields. To test: you'll notice about a 34% drop in performance with properties vs. fields if Unity isn't inlining them.
  • Interface.OSVR_CORE_DLL should be OsvrCoreDll.
  • Interface DllImport methods should be pascal cased. Use DllImport.EntryPoint to map them to their camel cased native methods.
  • Interface.registerCallback and overloads should be pascal cased.
  • Pose3, Quaternion, TimeValue, and Vec3 fields should be properties and pascal cased (assuming Unity inlines properties)

Unity4 to Unity5: dll x64 problem

hi

I just success running Oculus DK2 with OSVR in Unity4, and when I open that project folder with Unity5, I got this error message:

Failed to load 'Assets/Plugins/x86_64/osvrClientKit.dll' with error '%1 is not a valid Win32 application.
', GetDllDirectory returned ''. If GetDllDirectory returned non empty path, check that you're using SetDirectoryDll correctly.
OSVR.Unity.ClientKit:EnsureStarted() (at Assets/OSVRUnity/src/ClientKit.cs:76)
OSVR.Unity.ClientKit:EnsureStarted() (at Assets/OSVRUnity/src/ClientKit.cs:74)
OSVR.Unity.ClientKit:OnEnable() (at Assets/OSVRUnity/src/ClientKit.cs:99)

The osvrClientKit file I use from OSVR Code x64. I also try use osvrClientKit from x86 folder, but it shows up another error message:

Failed to load 'Assets/Plugins/x86_64/osvrClientKit.dll', expected 64 bit architecture (IMAGE_FILE_MACHINE_AMD64), but was IMAGE_FILE_MACHINE_I386.
OSVR.Unity.ClientKit:EnsureStarted() (at Assets/OSVRUnity/src/ClientKit.cs:76)
OSVR.Unity.ClientKit:EnsureStarted() (at Assets/OSVRUnity/src/ClientKit.cs:74)
OSVR.Unity.ClientKit:OnEnable() (at Assets/OSVRUnity/src/ClientKit.cs:99)

So.. I guess, I don't have right dll file Unity5 need.
The question is where can I find these dll x64 files?

thx

3d gui

It would be great to have a 3d gui menu component similar to OVRMainMenu in the Oculus SDK for displaying FPS and other stats/configuration information.

64-bit Unity support

This bug is the catch-all for any work required for 64-bit Unity builds that isn't a separate bug.

Includes:

  • Build system

Application.targetFrameRate is hardcoded to 60 fps

private const int TARGET_FRAME_RATE = 60; //@todo get from OSVR

I know, there is already a TODO there, but since osvr has an Oculus Rift DK2 plugin, a better setting may be -1 which will render as many fps as possible.

Right now it's a bit problematic because it is not documented in e.g. http://access.osvr.com/binary/download/misc_assets/Migrating%20Unity%20applications%20from%20Oculus%20to%20OSVR%20Feb-25-15.pdf

Update to Unity 5.0?

Is it too early to update our unity assets to Unity 5.0? I downloaded Unity 5.0 to get a dev environment setup to test changes and it asked to make a one-way project conversion for 5.0.

Additionally, when attempting to build devscene.unity in unity 5.0, I get the following errors:



Building Solution: OSVR-Unity (Debug)



Building: Assembly-CSharp (Debug)

Performing main compilation...

C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /noconfig "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
 -nostdlib
 "/out:C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Temp\bin\Debug\Assembly-CSharp.dll"
 "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll"
 "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll"
 "/r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll"
 "/r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll"
 "/r:C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll"
 "/r:C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll"
 "/r:C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll"
 "/r:C:/Users/JeremyBell/Desktop/OSVR-Unity/OSVR-Unity/Assets/Plugins/x86/ClientKit.dll"
 /nologo
 /warn:4
 /debug:full
 /optimize-
 "/define:DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN"

 /t:library
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Demo\Scripts\Managers\ColorManager.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Demo\Scripts\Objects\ColorChanger.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Scripts\HandleButtonPress.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Scripts\SampleAnalog.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Scripts\SampleButtonScript.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\ClientKit.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\DLLSearchPathFixer.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\DeviceDescriptor.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\DisplayInterface.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\GetParent.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\InterfaceBase.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\InterfaceCallbacks.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\InterfaceGameObject.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\Math.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\OrientationInterface.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\PoseInterface.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\PositionInterface.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\SimpleJSON.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VREye.cs"
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs"
 "/nowarn:0169"
 /fullpaths
 /utf8output


c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\Sample\Demo\Scripts\Objects\ColorChanger.cs(25,24): error CS1061: 'UnityEngine.Component' does not contain a definition for 'materials' and no extension method 'materials' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VREye.cs(49,24): error CS1061: 'UnityEngine.Component' does not contain a definition for 'CopyFrom' and no extension method 'CopyFrom' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VREye.cs(62,21): error CS0619: 'UnityEngine.Component.camera' is obsolete: 'Property camera has been deprecated. Use GetComponent<Camera>() instead. (UnityUpgradable)'

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VREye.cs(74,32): error CS1061: 'UnityEngine.Component' does not contain a definition for 'rect' and no extension method 'rect' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VREye.cs(77,32): error CS1061: 'UnityEngine.Component' does not contain a definition for 'rect' and no extension method 'rect' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(73,36): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(74,45): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(75,46): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(79,36): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(80,45): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(81,46): error CS1061: 'UnityEngine.Component' does not contain a definition for 'enabled' and no extension method 'enabled' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(105,21): error CS1502: The best overloaded method match for 'OSVR.Unity.VREye.MatchCamera(UnityEngine.Camera)' has some invalid arguments

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(105,44): error CS1503: Argument '1': cannot convert from 'UnityEngine.Component' to 'UnityEngine.Camera'

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(105,44): error CS0619: 'UnityEngine.Component.camera' is obsolete: 'Property camera has been deprecated. Use GetComponent<Camera>() instead. (UnityUpgradable)'

c:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\OSVRUnity\src\VRHead.cs(145,24): error CS1061: 'UnityEngine.Component' does not contain a definition for 'fieldOfView' and no extension method 'fieldOfView' accepting a first argument of type 'UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)







Build complete -- 15 errors, 0 warnings



Building: Assembly-CSharp-Editor (Debug)

Performing main compilation...

C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe /noconfig "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll"
 -nostdlib
 "/out:C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Temp\bin\Debug\Assembly-CSharp-Editor.dll"
 "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll"
 "/r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll"
 "/r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll"
 "/r:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll"
 "/r:C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll"
 "/r:C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll"
 "/r:C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll"
 "/r:C:/Users/JeremyBell/Desktop/OSVR-Unity/OSVR-Unity/Assets/Plugins/x86/ClientKit.dll"
 "/r:C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/androidplayer/UnityEditor.Android.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/wp8support/UnityEditor.WP8.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/metrosupport/UnityEditor.Metro.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/blackberryplayer/UnityEditor.BB10.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/webglsupport/UnityEditor.WebGL.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/linuxstandalonesupport/UnityEditor.LinuxStandalone.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll"
 "/r:C:/Program Files/Unity/Editor/Data/PlaybackEngines/macstandalonesupport/UnityEditor.OSXStandalone.Extensions.dll"
 /nologo
 /warn:4
 /debug:full
 /optimize-
 "/define:DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN"

 /t:library
 "C:\Users\JeremyBell\Desktop\OSVR-Unity\OSVR-Unity\Assets\Editor\OSVRUnityBuild.cs"
 "/nowarn:0169"
 /fullpaths
 /utf8output


Build complete -- 0 errors, 0 warnings



---------------------- Done ----------------------


Build: 15 errors, 0 warnings

Black screen at startup for some users.

Some users are experiencing a black screen at startup when running the palace demo and other Unity executables. Doesn't seem to be a problem in every build. Trying to gather more info on what might be the cause.

License for SimpleJSON.cs

When going through files, noticed that SimpleJSON was "vendored-in" but does not appear to have a license header. This file needs to be a: annotated with the correct license from upstream or b: removed and replaced with an alternative.

An addition to the NOTICE file might also be required depending on the license of that file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.