예제 #1
0
        //public void SetOverlayTransformType(VROverlayTransformType type) {
        //	_overlayTransformType = type;
        //}


        internal void SetTrackedDeviceRelativeIndex(DPOverlayTrackedDevice device, uint customDeviceIndex = 0, bool setTarget = true)
        {
            uint index = 0;

            switch (device)
            {
            case DPOverlayTrackedDevice.HMD:
                index = SteamVRManager.hmdIndex;
                break;

            case DPOverlayTrackedDevice.RightHand:
                index = SteamVRManager.rightHandIndex;
                break;

            case DPOverlayTrackedDevice.LeftHand:
                index = SteamVRManager.leftHandIndex;
                break;

            case DPOverlayTrackedDevice.CustomIndex:
                index = customDeviceIndex;
                break;

            default:
                index = 0;
                break;
            }

            VROverlayTransformType tType = device == DPOverlayTrackedDevice.None
                                ? VROverlayTransformType.VROverlayTransform_Absolute
                                : VROverlayTransformType.VROverlayTransform_TrackedDeviceRelative;

            _overlayTransformType = tType;
            _overlayTransformTrackedDeviceRelativeIndex = index;
            trackedDevice = device;

            if (setTarget)
            {
                targetTrackedDevice = device;
            }

            trackedDeviceUpdatedEvent?.Invoke(device);


            //TODO: Get target device index and transform type working sometime in the future
        }
예제 #2
0
	public abstract EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType);
예제 #3
0
	internal static extern EVROverlayError VR_IVROverlay_GetOverlayTransformType(IntPtr instancePtr, ulong ulOverlayHandle, ref VROverlayTransformType peTransformType);
예제 #4
0
	public override EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
	{
		CheckIfUsable();
		EVROverlayError result = VRNativeEntrypoints.VR_IVROverlay_GetOverlayTransformType(m_pVROverlay,ulOverlayHandle,ref peTransformType);
		return result;
	}
예제 #5
0
 public EVROverlayError SetOverlayRenderModel(ulong ulOverlayHandle, string pchRenderModel, ref HmdColor_t pColor) => default;                                                                                                                                                                   // 0x00000001811DED90-0x00000001811DEDC0
 public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType) => default;                                                                                                                                                                   // 0x00000001811DE6A0-0x00000001811DE6D0
예제 #6
0
    void UpdateOpts()
    {
        if (opts.pos != transform.position || opts.rot != transform.rotation)
        {
            matrixConverter.pos = transform.position;
            matrixConverter.rot = transform.rotation;

            overlay.overlayTransform = matrixConverter.ToHmdMatrix34();

            opts.pos = transform.position;
            opts.rot = transform.rotation;
        }

        if (opts.isVisible != isVisible)
        {
            overlay.overlayVisible = isVisible;

            opts.isVisible = isVisible;
        }

        if (opts.highQuality != highQuality)
        {
            overlay.overlayHighQuality = highQuality;

            opts.highQuality = highQuality;
        }

        if (opts.colorTint != colorTint)
        {
            overlay.overlayColor = colorTint;

            opts.colorTint = colorTint;
        }

        if (opts.opacity != opacity)
        {
            overlay.overlayAlpha = opacity;

            opts.opacity = opacity;
        }

        if (opts.widthInMeters != widthInMeters)
        {
            overlay.overlayWidthInMeters = widthInMeters;

            opts.widthInMeters = widthInMeters;
        }

        if (opts.deviceToTrack != deviceToTrack)
        {
            uint index = 0;
            switch (deviceToTrack)
            {
            case OverlayTrackedDevice.HMD:
                index = ovrHandler.poseHandler.hmdIndex;
                break;

            case OverlayTrackedDevice.RightHand:
                index = ovrHandler.poseHandler.rightIndex;
                break;

            case OverlayTrackedDevice.LeftHand:
                index = ovrHandler.poseHandler.leftIndex;
                break;

            case OverlayTrackedDevice.CustomIndex:
                index = customDeviceIndex;
                break;
            }

            VROverlayTransformType tType = deviceToTrack == OverlayTrackedDevice.None ?
                                           VROverlayTransformType.VROverlayTransform_Absolute :
                                           VROverlayTransformType.VROverlayTransform_TrackedDeviceRelative;

            overlay.overlayTransformType = tType;
            overlay.overlayTransformTrackedDeviceRelativeIndex = index;

            opts.deviceToTrack = deviceToTrack;
        }

        if (opts.customDeviceIndex != customDeviceIndex)
        {
            overlay.overlayTransformTrackedDeviceRelativeIndex = customDeviceIndex;
            opts.customDeviceIndex = customDeviceIndex;
        }

        if (opts.enableSimulatedMouse != enableSimulatedMouse)
        {
            overlay.overlayInputMethod =
                enableSimulatedMouse ? VROverlayInputMethod.Mouse : VROverlayInputMethod.None;

            opts.enableSimulatedMouse = enableSimulatedMouse;
        }

        if (opts.mouseScale != mouseScale)
        {
            mouseScale_t.v0 = mouseScale.x;
            mouseScale_t.v1 = mouseScale.y;

            overlay.overlayMouseScale = mouseScale_t;
            opts.mouseScale           = mouseScale;
        }
    }
예제 #7
0
 public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle, ref VROverlayTransformType peTransformType)
 {
     return(this.FnTable.GetOverlayTransformType(ulOverlayHandle, ref peTransformType));
 }
예제 #8
0
	public EVROverlayError GetOverlayTransformType(ulong ulOverlayHandle,ref VROverlayTransformType peTransformType)
	{
		EVROverlayError result = FnTable.GetOverlayTransformType(ulOverlayHandle,ref peTransformType);
		return result;
	}