This commit is contained in:
2016-05-18 20:02:15 +02:00
parent 62c8cf021f
commit 1e9b3a1498
225 changed files with 111146 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
//========= Copyright 2016, Valve Corporation, All rights reserved. ===========
//
// Purpose: Helper to update poses when using native OpenVR integration.
//
//=============================================================================
using UnityEngine;
using Valve.VR;
[RequireComponent(typeof(Camera))]
public class SteamVR_UpdatePoses : MonoBehaviour
{
void Awake()
{
var camera = GetComponent<Camera>();
#if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
camera.stereoTargetEye = StereoTargetEyeMask.None;
#endif
camera.clearFlags = CameraClearFlags.Nothing;
camera.useOcclusionCulling = false;
camera.cullingMask = 0;
camera.depth = -9999;
}
void OnPreCull()
{
var compositor = OpenVR.Compositor;
if (compositor != null)
{
var render = SteamVR_Render.instance;
compositor.GetLastPoses(render.poses, render.gamePoses);
SteamVR_Utils.Event.Send("new_poses", render.poses);
SteamVR_Utils.Event.Send("new_poses_applied");
}
}
}