Skip to content

Commit

Permalink
Merge pull request #15 from OSVR/osvrUnityUpdatev0.6.8.2
Browse files Browse the repository at this point in the history
Update to OSVRUnity v0.6.8.2
  • Loading branch information
DuFF14 committed Apr 22, 2016
2 parents 92cf1fa + 60d5401 commit 1636617
Show file tree
Hide file tree
Showing 111 changed files with 154 additions and 124 deletions.
19 changes: 11 additions & 8 deletions Assets/OSVRUnity/Prefabs/VRDisplayTracked.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: .100000001
near clip plane: 0.1
far clip plane: 1000
field of view: 60
orthographic: 0
Expand All @@ -145,10 +145,12 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!20 &2061704
Camera:
m_ObjectHideFlags: 1
Expand All @@ -158,14 +160,14 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: .300000012
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
Expand All @@ -177,10 +179,12 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!114 &11400508
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -229,7 +233,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2b982789045b4641a4c4898908314b3, type: 3}
m_Name:
m_EditorClassIdentifier:
showDirectModePreview: 1
showDirectModePreview: 0
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
Expand All @@ -241,4 +245,3 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 131736}
m_IsPrefabParent: 1
m_IsExploded: 1
53 changes: 33 additions & 20 deletions Assets/OSVRUnity/Prefabs/VRFirstPersonController.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 150058}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: .0799999237, y: .449999928, z: .240999937}
m_LocalPosition: {x: 0.07999992, y: 0.44999993, z: 0.24099994}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 450056}
Expand Down Expand Up @@ -175,7 +175,7 @@ Transform:
m_GameObject: {fileID: 163460}
m_LocalRotation: {x: -0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: .400000006, y: .5, z: .400000006}
m_LocalScale: {x: 0.4, y: 0.5, z: 0.4}
m_Children: []
m_Father: {fileID: 463458}
m_RootOrder: 0
Expand All @@ -188,14 +188,14 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: .300000012
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
Expand All @@ -207,10 +207,12 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!20 &2050054
Camera:
m_ObjectHideFlags: 1
Expand All @@ -220,14 +222,14 @@ Camera:
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: .100000001
near clip plane: 0.1
far clip plane: 1000
field of view: 60
orthographic: 0
Expand All @@ -239,28 +241,36 @@ Camera:
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: .0219999999
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!23 &2363460
Renderer:
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 163460}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_LightmapIndex: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_LightProbeAnchor: {fileID: 0}
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3363460
Expand Down Expand Up @@ -318,7 +328,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2b982789045b4641a4c4898908314b3, type: 3}
m_Name:
m_EditorClassIdentifier:
showDirectModePreview: 1
showDirectModePreview: 0
--- !u!114 &11463456
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -387,28 +397,32 @@ MonoBehaviour:
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
maxGroundAcceleration: 9999999
maxAirAcceleration: 20
gravity: 10
maxFallSpeed: 20
jumping:
enabled: 0
baseHeight: 1
extraHeight: 4.0999999
extraHeight: 4.1
perpAmount: 0
steepPerpAmount: .5
steepPerpAmount: 0.5
--- !u!143 &14363460
CharacterController:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 163458}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 1.79999995
m_Radius: .25
m_Height: 1.8
m_Radius: 0.25
m_SlopeLimit: 45
m_StepOffset: .400000006
m_SkinWidth: .0500000007
m_StepOffset: 0.4
m_SkinWidth: 0.05
m_MinMoveDistance: 0
m_Center: {x: 0, y: 0, z: 0}
--- !u!1001 &100100000
Expand All @@ -422,4 +436,3 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 163458}
m_IsPrefabParent: 1
m_IsExploded: 1
6 changes: 3 additions & 3 deletions Assets/OSVRUnity/src/DLLSearchPathFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ private bool IsIncludedInPath(string dir)
return NewDirs.Contains(dir) || OrigDirs.Contains(dir);
}

private string UnityDataDir;
private string UnityDataDirBackslashed;
private string UnityDataDir = string.Empty;
private string UnityDataDirBackslashed = string.Empty;
private List<string> NewDirs = new List<string>();
private List<string> OrigDirs;
private List<string> OrigDirs = null;

/// <summary>
/// Utilities for combining path components with a wider variety of input data types than System.IO.Path.Combine
Expand Down
9 changes: 8 additions & 1 deletion Assets/OSVRUnity/src/DisplayController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public OSVR.ClientKit.DisplayConfig DisplayConfig
public VRViewer[] Viewers { get { return _viewers; } }
public uint ViewerCount { get { return _viewerCount; } }
public OsvrRenderManager RenderManager { get { return _renderManager; } }
public bool showDirectModePreview = true; //should the monitor show what the user sees in the HMD?
[Tooltip("Renders an extra camera to show what the HMD user sees while in Direct Mode. Comes at a framerate cost until this feature becomes part of RenderManager.")]
public bool showDirectModePreview = false; //should the monitor show what the user sees in the HMD?

public uint TotalDisplayWidth
{
Expand Down Expand Up @@ -186,6 +187,12 @@ void SetupDisplay()

//create scene objects
CreateHeadAndEyes();

//create RenderBuffers in RenderManager
if(UseRenderManager && RenderManager != null)
{
RenderManager.ConstructBuffers();
}
SetRenderParams();
}

Expand Down
28 changes: 15 additions & 13 deletions Assets/OSVRUnity/src/OsvrRenderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public class OsvrRenderManager : MonoBehaviour
[DllImport(PluginName, CallingConvention = CallingConvention.Cdecl)]
private static extern Byte CreateRenderManagerFromUnity(OSVR.ClientKit.SafeClientContextHandle /*OSVR_ClientContext*/ ctx);

//Create and Register RenderBuffers
[DllImport(PluginName, CallingConvention = CallingConvention.Cdecl)]
private static extern Byte ConstructRenderBuffers();

[StructLayout(LayoutKind.Sequential)]
public struct OSVR_ViewportDescription
{
Expand Down Expand Up @@ -107,8 +111,6 @@ public struct OSVR_ProjectionMatrix
[DllImport(PluginName, CallingConvention = CallingConvention.Cdecl)]
private static extern void ShutdownRenderManager();

private OSVR.ClientKit.ClientContext _renderManagerClientContext;
private ClientKit _clientKit;
private bool _linkDebug = false; //causes crash on exit if true, only enable for debugging

//Initialize use of RenderManager via CreateRenderManager call
Expand All @@ -120,10 +122,15 @@ public int InitRenderManager()
//only use for debugging purposes, do not leave on for release.
LinkDebug(functionPointer); // Hook our c++ plugin into Unity's console log.
}
_clientKit = ClientKit.instance;
//create a client context for RenderManager. This context should not be updated from Unity.
_renderManagerClientContext = new OSVR.ClientKit.ClientContext("com.sensics.rendermanagercontext", 0);
return CreateRenderManager(_renderManagerClientContext);

return CreateRenderManager(ClientKit.instance.context);
}

//Create and Register RenderBuffers in RenderManager
//Called after RM is created and after Unity RenderTexture's are created and assigned via SetEyeColorBuffer
public int ConstructBuffers()
{
return ConstructRenderBuffers();
}

public void SetNearClippingPlaneDistance(float near)
Expand All @@ -145,7 +152,7 @@ public void SetIPDMeters(float ipd)
public void SetRoomRotationUsingHead()
{
#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4
_clientKit.context.SetRoomRotationUsingHead();
ClientKit.instance.context.SetRoomRotationUsingHead();
GL.IssuePluginEvent(GetRenderEventFunc(), 3);
#endif
}
Expand All @@ -154,7 +161,7 @@ public void SetRoomRotationUsingHead()
public void ClearRoomToWorldTransform()
{
#if UNITY_5_2 || UNITY_5_3 || UNITY_5_4
_clientKit.context.ClearRoomToWorldTransform();
ClientKit.instance.context.ClearRoomToWorldTransform();
GL.IssuePluginEvent(GetRenderEventFunc(), 4);
#endif
}
Expand Down Expand Up @@ -250,11 +257,6 @@ public IntPtr GetRenderEventFunction()
public void ExitRenderManager()
{
ShutdownRenderManager();
if (null != _renderManagerClientContext)
{
_renderManagerClientContext.Dispose();
_renderManagerClientContext = null;
}
}

//helper functions to determine is RenderManager is supported
Expand Down
3 changes: 0 additions & 3 deletions Assets/OSVRUnity/src/VRSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public class VRSurface : MonoBehaviour
public Texture2D PluginTexture;
[HideInInspector]
public RenderTexture RenderToTexture;
private Color[] m_Pixels;
private GCHandle m_PixelsHandle;
private Shader basicShader;

public Camera Camera { get { return _camera; } set { _camera = value; } }
public uint SurfaceIndex { get { return _surfaceIndex; } set { _surfaceIndex = value; } }
Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/Android/libs/armeabi-v7a/libcrystax.so.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Plugins/Android/libs/armeabi-v7a/libjsoncpp.so.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1636617

Please sign in to comment.