• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# VR.VREvent_t类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Valve.VR.VREvent_t的典型用法代码示例。如果您正苦于以下问题:C# VREvent_t类的具体用法?C# VREvent_t怎么用?C# VREvent_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VREvent_t类属于Valve.VR命名空间,在下文中一共展示了VREvent_t类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OpenVREventArgs

 public OpenVREventArgs(VREvent_t rawEvent)
 {
     EventType = (EVREventType)rawEvent.eventType;
     DeviceIndex = (int)rawEvent.trackedDeviceIndex;
     Age = rawEvent.eventAgeSeconds;
     EventData = rawEvent.data;
 }
开发者ID:domisterwoozy,项目名称:LabBox,代码行数:7,代码来源:OpenVRInputObservable.cs


示例2: PollNextEvent

    public bool PollNextEvent(ref VREvent_t pEvent)
    {
        var overlay = OpenVR.Overlay;
        if (overlay == null)
            return false;

        var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
        return overlay.PollNextOverlayEvent(handle, ref pEvent, size);
    }
开发者ID:taotetek,项目名称:HeadlessOverlayToolkit,代码行数:9,代码来源:SteamVR_Overlay.cs


示例3: PollNextEvent

 public bool PollNextEvent(ref VREvent_t pEvent)
 {
     CVROverlay overlay = OpenVR.Overlay;
     if (overlay == null)
     {
         return false;
     }
     uint uncbVREvent = (uint)Marshal.SizeOf(typeof(VREvent_t));
     return overlay.PollNextOverlayEvent(this.handle, ref pEvent, uncbVREvent);
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:10,代码来源:SteamVR_Overlay.cs


示例4: PollNextOverlayEvent

	public abstract bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例5: PollNextEventWithPose

	public abstract bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,ref TrackedDevicePose_t pTrackedDevicePose);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例6: PollNextEvent

	public abstract bool PollNextEvent(ref VREvent_t pEvent);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例7: VR_IVROverlay_PollNextOverlayEvent

	internal static extern bool VR_IVROverlay_PollNextOverlayEvent(IntPtr instancePtr, ulong ulOverlayHandle, ref VREvent_t pEvent);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例8: PollNextOverlayEvent

	public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
	{
		bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
		return result;
	}
开发者ID:apekshadarbari,项目名称:PokerFace,代码行数:5,代码来源:openvr_api.cs


示例9: PollNextEventWithPose

	public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
	{
		bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
		return result;
	}
开发者ID:apekshadarbari,项目名称:PokerFace,代码行数:5,代码来源:openvr_api.cs


示例10: PollNextEvent

	public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
	{
		bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
		return result;
	}
开发者ID:apekshadarbari,项目名称:PokerFace,代码行数:5,代码来源:openvr_api.cs


示例11: PollOverlayEvents

 static void PollOverlayEvents(ulong handle)
 {
     if (m_cvrOverlay.HandleControllerOverlayInteractionAsMouse(handle, m_controller2ID))
     {
         //controller points to the overlay and event was generated. Unsure if the call above must be called every tick to generate event
         VREvent_t oEvent=new VREvent_t();
         uint oEventSize=(uint)Marshal.SizeOf(oEvent);
         while( m_cvrOverlay.PollNextOverlayEvent(handle,ref oEvent, oEventSize))
         {
             Log.WriteLineAndConsole("OVERLAY event (#"+oEvent.trackedDeviceIndex+"): " + oEvent.eventType.ToString() + " " + Enum.GetName(typeof(EVREventType), oEvent.eventType));
             switch(oEvent.eventType)
             {
                 case (uint)EVREventType.VREvent_MouseMove:
                     if (oEvent.trackedDeviceIndex==m_controller2ID)
                         Log.WriteLineAndConsole("  " + oEvent.data.mouse.x + "," + oEvent.data.mouse.y);
                     break;
             }
         }
     };
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:20,代码来源:MyOpenVR.cs


示例12: PollNextEvent

 public bool PollNextEvent(ref VREvent_t pEvent)
 {
     var vr = SteamVR.instance;
     return vr.overlay.PollNextOverlayEvent(handle, ref pEvent);
 }
开发者ID:asmccormick,项目名称:vive-catch,代码行数:5,代码来源:SteamVR_Overlay.cs


示例13: VR_IVRSystem_PollNextEvent

	internal static extern bool VR_IVRSystem_PollNextEvent(IntPtr instancePtr, ref VREvent_t pEvent);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例14: Update

    void Update()
    {
        if (cameras.Length == 0)
        {
            enabled = false;
            return;
        }

        // Force controller update in case no one else called this frame to ensure prevState gets updated.
        SteamVR_Controller.Update();

        // Dispatch any OpenVR events.
        var vr = SteamVR.instance;
        var vrEvent = new VREvent_t();
        for (int i = 0; i < 64; i++)
        {
            if (!vr.hmd.PollNextEvent(ref vrEvent))
                break;

            switch ((EVREventType)vrEvent.eventType)
            {
                case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
                    SteamVR_Utils.Event.Send("input_focus", false);
                    break;
                case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
                    SteamVR_Utils.Event.Send("input_focus", true);
                    break;
                default:
                    var name = System.Enum.GetName(typeof(EVREventType), vrEvent.eventType);
                    if (name != null)
                        SteamVR_Utils.Event.Send(name.Substring(8) /*strip VREvent_*/, vrEvent);
                    break;
            }
        }

        // Ensure various settings to minimize latency.
        Application.targetFrameRate = -1;
        Application.runInBackground = true; // don't require companion window focus
        QualitySettings.maxQueuedFrames = -1;
        QualitySettings.vSyncCount = 0; // this applies to the companion window
        Time.fixedDeltaTime = 1.0f / vr.hmd_DisplayFrequency;
    }
开发者ID:nyu-vr-research,项目名称:vive-holojam,代码行数:42,代码来源:SteamVR_Render.cs


示例15: VR_IVRSystem_PollNextEventWithPose

	internal static extern bool VR_IVRSystem_PollNextEventWithPose(IntPtr instancePtr, ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, ref TrackedDevicePose_t pTrackedDevicePose);
开发者ID:Black4Blade,项目名称:NewtonVR,代码行数:1,代码来源:openvr_api.cs


示例16: Update

    void Update()
    {
        #if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
        if (poseUpdater == null)
        {
            var go = new GameObject("poseUpdater");
            go.transform.parent = transform;
            poseUpdater = go.AddComponent<SteamVR_UpdatePoses>();
        }
        #else
        if (cameras.Length == 0)
        {
            enabled = false;
            return;
        }

        // If our FixedUpdate rate doesn't match our render framerate, then catch the handoff here.
        SteamVR_Utils.QueueEventOnRenderThread(SteamVR.Unity.k_nRenderEventID_PostPresentHandoff);
        #endif
        // Force controller update in case no one else called this frame to ensure prevState gets updated.
        SteamVR_Controller.Update();

        // Dispatch any OpenVR events.
        var system = OpenVR.System;
        if (system != null)
        {
            var vrEvent = new VREvent_t();
            var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
            for (int i = 0; i < 64; i++)
            {
                if (!system.PollNextEvent(ref vrEvent, size))
                    break;

                switch ((EVREventType)vrEvent.eventType)
                {
                    case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
                        if (vrEvent.data.process.oldPid == 0)
                        {
                            SteamVR_Utils.Event.Send("input_focus", false);
                        }
                        break;
                    case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
                        if (vrEvent.data.process.pid == 0)
                        {
                            SteamVR_Utils.Event.Send("input_focus", true);
                        }
                        break;
                    case EVREventType.VREvent_ShowRenderModels:
                        SteamVR_Utils.Event.Send("hide_render_models", false);
                        break;
                    case EVREventType.VREvent_HideRenderModels:
                        SteamVR_Utils.Event.Send("hide_render_models", true);
                        break;
                    default:
                        var name = System.Enum.GetName(typeof(EVREventType), vrEvent.eventType);
                        if (name != null)
                            SteamVR_Utils.Event.Send(name.Substring(8) /*strip VREvent_*/, vrEvent);
                        break;
                }
            }
        }

        // Ensure various settings to minimize latency.
        Application.targetFrameRate = -1;
        Application.runInBackground = true; // don't require companion window focus
        QualitySettings.maxQueuedFrames = -1;
        QualitySettings.vSyncCount = 0; // this applies to the companion window

        if (lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0.0f)
        {
            var vr = SteamVR.instance;
            if (vr != null)
            {
                var timing = new Compositor_FrameTiming();
                timing.m_nSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Compositor_FrameTiming));
                vr.compositor.GetFrameTiming(ref timing, 0);

                Time.fixedDeltaTime = Time.timeScale / vr.hmd_DisplayFrequency;
                Time.maximumDeltaTime = Time.fixedDeltaTime * timing.m_nNumFramePresents;
            }
        }
    }
开发者ID:ConstLiu,项目名称:openvr,代码行数:82,代码来源:SteamVR_Render.cs


示例17: PollEvents

 private void PollEvents(object stateIgnored)
 {
     VREvent_t vrEvent = new VREvent_t();
     while (hmd.PollNextEvent(ref vrEvent, (uint)Marshal.SizeOf<VREvent_t>()))
     {
         OpenVREvent?.Invoke(this, new OpenVREventArgs(vrEvent));
     }
 }
开发者ID:domisterwoozy,项目名称:LabBox,代码行数:8,代码来源:OpenVRInputObservable.cs



注:本文中的Valve.VR.VREvent_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VR.VRTextureBounds_t类代码示例发布时间:2022-05-26
下一篇:
C# VR.TrackedDevicePose_t类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap