예제 #1
0
 public EVROverlayError GetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale) => default;                                                                                                                                                                                 // 0x00000001811DE3F0-0x00000001811DE420
 public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale) => default;                                                                                                                                                                                 // 0x00000001811DECE0-0x00000001811DED10
예제 #2
0
 // Token: 0x06001F0B RID: 7947 RVA: 0x0009CE7D File Offset: 0x0009B07D
 public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter)
 {
     return(this.FnTable.GetCameraIntrinsics(nDeviceIndex, eFrameType, ref pFocalLength, ref pCenter));
 }
예제 #3
0
 public bool IsOverlayVisible(ulong ulOverlayHandle) => default;                                                                                                                                                                                                                                 // 0x00000001811DE880-0x00000001811DE8B0
 public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform) => default;                                                                                        // 0x00000001811DE730-0x00000001811DE760
예제 #4
0
 public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform)
 {
     return(this.FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle, eTrackingOrigin, coordinatesInOverlay, ref pmatTransform));
 }
예제 #5
0
 public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale)
 {
     return(this.FnTable.SetOverlayMouseScale(ulOverlayHandle, ref pvecMouseScale));
 }
예제 #6
0
	public abstract EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale);
예제 #7
0
 internal static extern bool VR_IVRSystem_HandleControllerOverlayInteractionAsMouse(IntPtr instancePtr, IntPtr overlaySettings, HmdVector2_t vecWindowClientPositionOnScreen, HmdVector2_t vecWindowClientSize, uint unControllerDeviceIndex, uint eOutputType);
예제 #8
0
파일: openvr_api.cs 프로젝트: Chazman11/SGJ
	public EVRTrackedCameraError GetCameraIntrinisics(uint nDeviceIndex,EVRTrackedCameraFrameType eFrameType,ref HmdVector2_t pFocalLength,ref HmdVector2_t pCenter)
	{
		EVRTrackedCameraError result = FnTable.GetCameraIntrinisics(nDeviceIndex,eFrameType,ref pFocalLength,ref pCenter);
		return result;
	}
예제 #9
0
	public void UpdateOverlay()
	{
		var overlay = OpenVR.Overlay;
		if (overlay == null)
			return;

		if (texture != null)
		{
			var error = overlay.ShowOverlay(handle);
			if (error == EVROverlayError.InvalidHandle || error == EVROverlayError.UnknownOverlay)
			{
				if (overlay.FindOverlay(key, ref handle) != EVROverlayError.None)
					return;
			}

			var tex = new Texture_t();
			tex.handle = texture.GetNativeTexturePtr();
			tex.eType = SteamVR.instance.graphicsAPI;
			tex.eColorSpace = EColorSpace.Auto;
            overlay.SetOverlayTexture(handle, ref tex);

			overlay.SetOverlayAlpha(handle, alpha);
			overlay.SetOverlayWidthInMeters(handle, scale);
			overlay.SetOverlayAutoCurveDistanceRangeInMeters(handle, curvedRange.x, curvedRange.y);

			var textureBounds = new VRTextureBounds_t();
			textureBounds.uMin = (0 + uvOffset.x) * uvOffset.z;
			textureBounds.vMin = (1 + uvOffset.y) * uvOffset.w;
			textureBounds.uMax = (1 + uvOffset.x) * uvOffset.z;
			textureBounds.vMax = (0 + uvOffset.y) * uvOffset.w;
			overlay.SetOverlayTextureBounds(handle, ref textureBounds);

			var vecMouseScale = new HmdVector2_t();
			vecMouseScale.v0 = mouseScale.x;
			vecMouseScale.v1 = mouseScale.y;
			overlay.SetOverlayMouseScale(handle, ref vecMouseScale);

			var vrcam = SteamVR_Render.Top();
			if (vrcam != null && vrcam.origin != null)
			{
				var offset = new SteamVR_Utils.RigidTransform(vrcam.origin, transform);
				offset.pos.x /= vrcam.origin.localScale.x;
				offset.pos.y /= vrcam.origin.localScale.y;
				offset.pos.z /= vrcam.origin.localScale.z;

				offset.pos.z += distance;

				var t = offset.ToHmdMatrix34();
				overlay.SetOverlayTransformAbsolute(handle, SteamVR_Render.instance.trackingSpace, ref t);
			}

			overlay.SetOverlayInputMethod(handle, inputMethod);

			if (curved || antialias)
				highquality = true;

			if (highquality)
			{
				overlay.SetHighQualityOverlay(handle);
				overlay.SetOverlayFlag(handle, VROverlayFlags.Curved, curved);
				overlay.SetOverlayFlag(handle, VROverlayFlags.RGSS4X, antialias);
			}
			else if (overlay.GetHighQualityOverlay() == handle)
			{
				overlay.SetHighQualityOverlay(OpenVR.k_ulOverlayHandleInvalid);
			}
		}
		else
		{
			overlay.HideOverlay(handle);
		}
	}
예제 #10
0
	internal static extern EVROverlayError VR_IVROverlay_GetTransformForOverlayCoordinates(IntPtr instancePtr, ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, HmdVector2_t coordinatesInOverlay, ref HmdMatrix34_t pmatTransform);
예제 #11
0
	public abstract EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform);
예제 #12
0
	public override EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
	{
		CheckIfUsable();
		EVROverlayError result = VRNativeEntrypoints.VR_IVROverlay_GetTransformForOverlayCoordinates(m_pVROverlay,ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
		return result;
	}
예제 #13
0
 public EVRTrackedCameraError GetCameraFrameSize(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref uint pnWidth, ref uint pnHeight, ref uint pnFrameBufferSize) => default;                                                                                        // 0x00000001811E1060-0x00000001811E10A0
 public EVRTrackedCameraError GetCameraIntrinsics(uint nDeviceIndex, EVRTrackedCameraFrameType eFrameType, ref HmdVector2_t pFocalLength, ref HmdVector2_t pCenter) => default;                                                                                               // 0x00000001811E10A0-0x00000001811E10D0
예제 #14
0
 internal static extern bool VR_IVRCompositor_ComputeOverlayIntersection(IntPtr instancePtr, ref Compositor_OverlaySettings pSettings, float fAspectRatio, TrackingUniverseOrigin eOrigin, HmdVector3_t vSource, HmdVector3_t vDirection, ref HmdVector2_t pvecIntersectionUV, ref HmdVector3_t pvecIntersectionTrackingSpace);
예제 #15
0
	public override EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
	{
		CheckIfUsable();
		EVROverlayError result = VRNativeEntrypoints.VR_IVROverlay_SetOverlayMouseScale(m_pVROverlay,ulOverlayHandle,ref pvecMouseScale);
		return result;
	}
예제 #16
0
	public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,HmdVector2_t coordinatesInOverlay,ref HmdMatrix34_t pmatTransform)
	{
		EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform);
		return result;
	}
예제 #17
0
	internal static extern EVROverlayError VR_IVROverlay_SetOverlayMouseScale(IntPtr instancePtr, ulong ulOverlayHandle, ref HmdVector2_t pvecMouseScale);
예제 #18
0
	public EVROverlayError SetOverlayMouseScale(ulong ulOverlayHandle,ref HmdVector2_t pvecMouseScale)
	{
		EVROverlayError result = FnTable.SetOverlayMouseScale(ulOverlayHandle,ref pvecMouseScale);
		return result;
	}
예제 #19
0
        public void UpdateOverlay()
        {
            var overlay = OpenVR.Overlay;

            if (overlay == null)
            {
                return;
            }

            if (texture != null)
            {
                var error = overlay.ShowOverlay(handle);
                if (error == EVROverlayError.InvalidHandle || error == EVROverlayError.UnknownOverlay)
                {
                    if (overlay.FindOverlay(key, ref handle) != EVROverlayError.None)
                    {
                        return;
                    }
                }

                var tex = new Texture_t();
                tex.handle      = texture.GetNativeTexturePtr();
                tex.eType       = SteamVR.instance.textureType;
                tex.eColorSpace = EColorSpace.Auto;
                overlay.SetOverlayTexture(handle, ref tex);

                overlay.SetOverlayAlpha(handle, alpha);
                overlay.SetOverlayWidthInMeters(handle, scale);
                overlay.SetOverlayAutoCurveDistanceRangeInMeters(handle, curvedRange.x, curvedRange.y);

                var textureBounds = new VRTextureBounds_t();
                textureBounds.uMin = (0 + uvOffset.x) * uvOffset.z;
                textureBounds.vMin = (1 + uvOffset.y) * uvOffset.w;
                textureBounds.uMax = (1 + uvOffset.x) * uvOffset.z;
                textureBounds.vMax = (0 + uvOffset.y) * uvOffset.w;
                overlay.SetOverlayTextureBounds(handle, ref textureBounds);

                var vecMouseScale = new HmdVector2_t();
                vecMouseScale.v0 = mouseScale.x;
                vecMouseScale.v1 = mouseScale.y;
                overlay.SetOverlayMouseScale(handle, ref vecMouseScale);

                var vrcam = SteamVR_Render.Top();
                if (vrcam != null && vrcam.origin != null)
                {
                    var offset = new SteamVR_Utils.RigidTransform(vrcam.origin, transform);
                    offset.pos.x /= vrcam.origin.localScale.x;
                    offset.pos.y /= vrcam.origin.localScale.y;
                    offset.pos.z /= vrcam.origin.localScale.z;

                    offset.pos.z += distance;

                    var t = offset.ToHmdMatrix34();
                    overlay.SetOverlayTransformAbsolute(handle, SteamVR.settings.trackingSpace, ref t);
                }

                overlay.SetOverlayInputMethod(handle, inputMethod);

                if (curved || antialias)
                {
                    highquality = true;
                }

                if (highquality)
                {
                    overlay.SetHighQualityOverlay(handle);
                    overlay.SetOverlayFlag(handle, VROverlayFlags.Curved, curved);
                    overlay.SetOverlayFlag(handle, VROverlayFlags.RGSS4X, antialias);
                }
                else if (overlay.GetHighQualityOverlay() == handle)
                {
                    overlay.SetHighQualityOverlay(OpenVR.k_ulOverlayHandleInvalid);
                }
            }
            else
            {
                overlay.HideOverlay(handle);
            }
        }
    public void UpdateOverlay(SteamVR vr)
    {
        if (texture != null)
        {
            var error = vr.overlay.ShowOverlay(handle);
            if (error == VROverlayError.InvalidHandle || error == VROverlayError.UnknownOverlay)
            {
                if (vr.overlay.FindOverlay(key, ref handle) != VROverlayError.None)
                    return;
            }

            vr.overlay.SetOverlayTexture(handle, texture.GetNativeTexturePtr());
            vr.overlay.SetOverlayAlpha(handle, alpha);
            vr.overlay.SetOverlayGamma(handle, gamma);
            vr.overlay.SetOverlayWidthInMeters(handle, scale);

            var textureBounds = new VRTextureBounds_t();
            textureBounds.uMin = (0 + uvOffset.x) * uvOffset.z;
            textureBounds.vMin = (1 + uvOffset.y) * uvOffset.w;
            textureBounds.uMax = (1 + uvOffset.x) * uvOffset.z;
            textureBounds.vMax = (0 + uvOffset.y) * uvOffset.w;
            vr.overlay.SetOverlayTextureBounds(handle, ref textureBounds);

            var vecMouseScale = new HmdVector2_t();
            vecMouseScale.v = new float[] { mouseScale.x, mouseScale.y };
            vr.overlay.SetOverlayMouseScale(handle, ref vecMouseScale);

            var vrcam = SteamVR_Render.Top();
            if (vrcam != null && vrcam.origin != null)
            {
                var offset = new SteamVR_Utils.RigidTransform(vrcam.origin, transform);
                offset.pos.x /= vrcam.origin.localScale.x;
                offset.pos.y /= vrcam.origin.localScale.y;
                offset.pos.z /= vrcam.origin.localScale.z;

                offset.pos.z += distance;

                var t = offset.ToHmdMatrix34();
                vr.overlay.SetOverlayTransformAbsolute(handle, SteamVR_Render.instance.trackingSpace, ref t);
            }

            vr.overlay.SetOverlayVisibility(handle, visibility);
            vr.overlay.SetOverlayInputMethod(handle, inputMethod);

            if (curved || antialias)
                highquality = true;

            if (highquality)
            {
                vr.overlay.SetHighQualityOverlay(handle);
                vr.overlay.SetOverlayFlag(handle, VROverlayFlags.Curved, curved);
                vr.overlay.SetOverlayFlag(handle, VROverlayFlags.RGSS4X, antialias);
            }
            else if (vr.overlay.GetHighQualityOverlay() == handle)
            {
                vr.overlay.SetHighQualityOverlay(OpenVR.k_ulOverlayHandleInvalid);
            }
        }
        else
        {
            vr.overlay.HideOverlay(handle);
        }
    }