本文整理汇总了C#中Valve.VR.VREvent_t类的典型用法代码示例。如果您正苦于以下问题:C# VREvent_t类的具体用法?C# VREvent_t怎么用?C# VREvent_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VREvent_t类属于Valve.VR命名空间,在下文中一共展示了VREvent_t类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenVREventArgs
public OpenVREventArgs(VREvent_t rawEvent)
{
EventType = (EVREventType)rawEvent.eventType;
DeviceIndex = (int)rawEvent.trackedDeviceIndex;
Age = rawEvent.eventAgeSeconds;
EventData = rawEvent.data;
}
示例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);
}
示例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);
}
示例4: PollNextOverlayEvent
public abstract bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent);
示例5: PollNextEventWithPose
public abstract bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,ref TrackedDevicePose_t pTrackedDevicePose);
示例6: PollNextEvent
public abstract bool PollNextEvent(ref VREvent_t pEvent);
示例7: VR_IVROverlay_PollNextOverlayEvent
internal static extern bool VR_IVROverlay_PollNextOverlayEvent(IntPtr instancePtr, ulong ulOverlayHandle, ref VREvent_t pEvent);
示例8: PollNextOverlayEvent
public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
{
bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
return result;
}
示例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;
}
示例10: PollNextEvent
public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
{
bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
return result;
}
示例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;
}
}
};
}
示例12: PollNextEvent
public bool PollNextEvent(ref VREvent_t pEvent)
{
var vr = SteamVR.instance;
return vr.overlay.PollNextOverlayEvent(handle, ref pEvent);
}
示例13: VR_IVRSystem_PollNextEvent
internal static extern bool VR_IVRSystem_PollNextEvent(IntPtr instancePtr, ref VREvent_t pEvent);
示例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;
}
示例15: VR_IVRSystem_PollNextEventWithPose
internal static extern bool VR_IVRSystem_PollNextEventWithPose(IntPtr instancePtr, ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, ref TrackedDevicePose_t pTrackedDevicePose);