Created
February 25, 2016 23:25
-
-
Save cabbibo/22cb53b6c4f4c557d326 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using Valve.VR; | |
public class GetCollisionBounds : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
var error = EVRInitError.None; | |
if (!SteamVR.active) | |
{ | |
OpenVR.Init(ref error, EVRApplicationType.VRApplication_Other); | |
if (error != EVRInitError.None){ | |
return; | |
} | |
} | |
var pChaperone = OpenVR.GetGenericInterface(OpenVR.IVRChaperone_Version, ref error); | |
if (pChaperone == System.IntPtr.Zero || error != EVRInitError.None) | |
{ | |
if (!SteamVR.active) | |
OpenVR.Shutdown(); | |
return; | |
} | |
var chaperone = new CVRChaperone(pChaperone); | |
var chaperoneSetup = new CVRChaperoneSetup(pChaperone); | |
var pQuadsBuffer = new HmdQuad_t[20]; | |
var bounds = chaperoneSetup.GetLiveCollisionBoundsInfo(ref pQuadsBuffer ); | |
print( chaperone ); | |
print( chaperoneSetup ); | |
print( rect ); | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment