void RenderEye(SteamVR vr, Hmd_Eye eye, LayerMask mask) { int i = (int)eye; SteamVR_Render.eye = eye; if (cameraMask != null) { cameraMask.Set(vr, eye); } foreach (var c in cameras) { c.transform.localPosition = vr.eyes[i].pos; c.transform.localRotation = vr.eyes[i].rot; // Update position to keep from getting culled cameraMask.transform.position = c.transform.position; var camera = c.GetComponent <Camera>(); camera.targetTexture = SteamVR_Camera.GetSceneTexture(camera.hdr); int cullingMask = camera.cullingMask; camera.cullingMask |= mask; camera.Render(); camera.cullingMask = cullingMask; } }
internal static extern DistortionCoordinates_t SteamAPI_vr_IHmd_ComputeDistortion(IntPtr instancePtr, Hmd_Eye eEye, float fU, float fV);
internal static extern HmdMatrix44_t SteamAPI_vr_IHmd_GetProjectionMatrix(IntPtr instancePtr, Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType);
void RenderEye(SteamVR vr, Hmd_Eye eye, LayerMask mask) { int i = (int)eye; SteamVR_Render.eye = eye; if (cameraMask != null) cameraMask.Set(vr, eye); foreach (var c in cameras) { c.transform.localPosition = vr.eyes[i].pos; c.transform.localRotation = vr.eyes[i].rot; // Update position to keep from getting culled cameraMask.transform.position = c.transform.position; var camera = c.GetComponent<Camera>(); camera.targetTexture = SteamVR_Camera.GetSceneTexture(camera.hdr); int cullingMask = camera.cullingMask; camera.cullingMask |= mask; camera.Render(); camera.cullingMask = cullingMask; } }
/** Returns the transform from eye space to the head space. Eye space is the per-eye flavor of head * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. * Normally View and Eye^-1 will be multiplied together and treated as View in your application. */ public HmdMatrix34_t GetHeadFromEyePose(Hmd_Eye eEye) { return(SteamVR.GetHeadFromEyePose(m_pNativeObject, eEye)); }
/** The components necessary to build your own projection matrix in case your * application is doing something fancy like infinite Z */ public void GetProjectionRaw(Hmd_Eye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom) { SteamVR.GetProjectionRaw(m_pNativeObject, eEye, ref pfLeft, ref pfRight, ref pfTop, ref pfBottom); }
/** Returns the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in * the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. */ public DistortionCoordinates_t ComputeDistortion(Hmd_Eye eEye, float fU, float fV) { return SteamVR.ComputeDistortion(m_pNativeObject, eEye, fU, fV); }
public abstract HmdMatrix44_t GetProjectionMatrix(Hmd_Eye eEye,float fNearZ,float fFarZ,GraphicsAPIConvention eProjType);
public abstract HiddenAreaMesh_t GetHiddenAreaMesh(Hmd_Eye eEye);
public abstract HmdMatrix34_t GetEyeToHeadTransform(Hmd_Eye eEye);
public abstract void GetEyeOutputViewport(Hmd_Eye eEye,ref uint pnX,ref uint pnY,ref uint pnWidth,ref uint pnHeight);
public abstract DistortionCoordinates_t ComputeDistortion(Hmd_Eye eEye,float fU,float fV);
public abstract VRCompositorError Submit(Hmd_Eye eEye,GraphicsAPIConvention eTextureType,IntPtr pTexture,ref VRTextureBounds_t pBounds,VRSubmitFlags_t nSubmitFlags);
public static extern void GetEyeOutputViewport(System.IntPtr pHmd, Hmd_Eye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
public static extern HmdMatrix44_t GetProjectionMatrix(System.IntPtr pHmd, Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType);
public abstract void GetProjectionRaw(Hmd_Eye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom);
/** Returns the transform from eye space to the head space. Eye space is the per-eye flavor of head * space that provides stereo disparity. Instead of Model * View * Projection the sequence is Model * View * Eye^-1 * Projection. * Normally View and Eye^-1 will be multiplied together and treated as View in your application. */ public HmdMatrix34_t GetHeadFromEyePose(Hmd_Eye eEye) { return SteamVR.GetHeadFromEyePose(m_pNativeObject, eEye); }
internal static extern DistortionCoordinates_t VR_IVRSystem_ComputeDistortion(IntPtr instancePtr, Hmd_Eye eEye, float fU, float fV);
public override void GetProjectionRaw(Hmd_Eye eEye,ref float pfLeft,ref float pfRight,ref float pfTop,ref float pfBottom) { CheckIfUsable(); pfLeft = 0; pfRight = 0; pfTop = 0; pfBottom = 0; VRNativeEntrypoints.VR_IVRSystem_GetProjectionRaw(m_pVRSystem,eEye,ref pfLeft,ref pfRight,ref pfTop,ref pfBottom); }
internal static extern void VR_IVRSystem_GetEyeOutputViewport(IntPtr instancePtr, Hmd_Eye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
/** Returns the result of the distortion function for the specified eye and input UVs. UVs go from 0,0 in * the upper left of that eye's viewport and 1,1 in the lower right of that eye's viewport. */ public DistortionCoordinates_t ComputeDistortion(Hmd_Eye eEye, float fU, float fV) { return(SteamVR.ComputeDistortion(m_pNativeObject, eEye, fU, fV)); }
internal static extern HmdMatrix34_t VR_IVRSystem_GetEyeToHeadTransform(IntPtr instancePtr, Hmd_Eye eEye);
internal static extern HiddenAreaMesh_t VR_IVRSystem_GetHiddenAreaMesh(IntPtr instancePtr, Hmd_Eye eEye);
internal static extern void SteamAPI_vr_IHmd_GetEyeOutputViewport(IntPtr instancePtr, Hmd_Eye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight);
internal static extern HmdMatrix44_t VR_IVRSystem_GetProjectionMatrix(IntPtr instancePtr, Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType);
internal static extern void SteamAPI_vr_IHmd_GetProjectionRaw(IntPtr instancePtr, Hmd_Eye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
internal static extern void VR_IVRSystem_GetProjectionRaw(IntPtr instancePtr, Hmd_Eye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
internal static extern HmdMatrix34_t SteamAPI_vr_IHmd_GetHeadFromEyePose(IntPtr instancePtr, Hmd_Eye eEye);
public static extern HmdMatrix34_t GetHeadFromEyePose(System.IntPtr pHmd, Hmd_Eye eEye);
public static extern void GetProjectionRaw(System.IntPtr pHmd, Hmd_Eye eEye, ref float pfLeft, ref float pfRight, ref float pfTop, ref float pfBottom);
public static extern DistortionCoordinates_t ComputeDistortion(System.IntPtr pHmd, Hmd_Eye eEye, float fU, float fV);
/** Gets the viewport in the frame buffer to draw the output of the distortion into */ public void GetEyeOutputViewport(Hmd_Eye eEye, ref uint pnX, ref uint pnY, ref uint pnWidth, ref uint pnHeight) { SteamVR.GetEyeOutputViewport(m_pNativeObject, eEye, ref pnX, ref pnY, ref pnWidth, ref pnHeight); }
/** The projection matrix for the specified eye */ public HmdMatrix44_t GetProjectionMatrix(Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType) { return SteamVR.GetProjectionMatrix(m_pNativeObject, eEye, fNearZ, fFarZ, eProjType); }
/** The projection matrix for the specified eye */ public HmdMatrix44_t GetProjectionMatrix(Hmd_Eye eEye, float fNearZ, float fFarZ, GraphicsAPIConvention eProjType) { return(SteamVR.GetProjectionMatrix(m_pNativeObject, eEye, fNearZ, fFarZ, eProjType)); }