Torque3D Documentation / _generateds / openVROverlay.h

openVROverlay.h

Engine/source/platform/input/openVR/openVROverlay.h

More...

Classes:

Public Typedefs

vr::EGamepadTextInputLineMode
OpenVRGamepadTextInputLineMode 
vr::EGamepadTextInputMode
OpenVRGamepadTextInputMode 
vr::EOverlayDirection
OpenVROverlayDirection 
vr::VROverlayInputMethod
OpenVROverlayInputMethod 
vr::VROverlayTransformType
OpenVROverlayTransformType 
OpenVROverlayType 
vr::EVRState
OpenVRState 
vr::ETrackingResult
OpenVRTrackingResult 
vr::ETrackingUniverseOrigin
OpenVRTrackingUniverseOrigin 

Detailed Description

Public Typedefs

typedef vr::EGamepadTextInputLineMode OpenVRGamepadTextInputLineMode 
typedef vr::EGamepadTextInputMode OpenVRGamepadTextInputMode 
typedef vr::EOverlayDirection OpenVROverlayDirection 
typedef vr::VROverlayInputMethod OpenVROverlayInputMethod 
typedef vr::VROverlayTransformType OpenVROverlayTransformType 
typedef OpenVROverlay::OverlayType OpenVROverlayType 
typedef vr::EVRState OpenVRState 
typedef vr::ETrackingResult OpenVRTrackingResult 
typedef vr::ETrackingUniverseOrigin OpenVRTrackingUniverseOrigin 

Public Functions

DefineEnumType(OpenVROverlayType )

  1
  2#ifndef _OPENVROVERLAY_H_
  3#define _OPENVROVERLAY_H_
  4
  5#ifndef _GUIOFFSCREENCANVAS_H_
  6#include "gui/core/guiOffscreenCanvas.h"
  7#endif
  8#ifndef _OPENVRDEVICE_H_
  9#include "platform/input/openVR/openVRProvider.h"
 10#endif
 11#ifndef _COLLISION_H_
 12#include "collision/collision.h"
 13#endif
 14
 15
 16typedef vr::VROverlayInputMethod OpenVROverlayInputMethod;
 17typedef vr::VROverlayTransformType OpenVROverlayTransformType;
 18typedef vr::EGamepadTextInputMode OpenVRGamepadTextInputMode;
 19typedef vr::EGamepadTextInputLineMode OpenVRGamepadTextInputLineMode;
 20typedef vr::ETrackingResult OpenVRTrackingResult;
 21typedef vr::ETrackingUniverseOrigin OpenVRTrackingUniverseOrigin;
 22typedef vr::EOverlayDirection OpenVROverlayDirection;
 23typedef vr::EVRState OpenVRState;
 24
 25class OpenVROverlay : public GuiOffscreenCanvas
 26{
 27public:
 28   typedef GuiOffscreenCanvas Parent;
 29
 30   enum OverlayType
 31   {
 32      OVERLAYTYPE_OVERLAY,
 33      OVERLAYTYPE_DASHBOARD,
 34   };
 35
 36   vr::VROverlayHandle_t mOverlayHandle;
 37   vr::VROverlayHandle_t mThumbOverlayHandle;
 38
 39   // Desired OpenVR state
 40   U32 mOverlayFlags;
 41   F32 mOverlayWidth;
 42
 43   vr::VROverlayTransformType mOverlayTransformType;
 44   MatrixF mTransform;
 45   vr::TrackedDeviceIndex_t mTransformDeviceIndex;
 46   String mTransformDeviceComponent;
 47
 48
 49   vr::VROverlayInputMethod mInputMethod;
 50   Point2F mMouseScale;
 51
 52   vr::ETrackingUniverseOrigin mTrackingOrigin;
 53   vr::TrackedDeviceIndex_t mControllerDeviceIndex;
 54
 55   GFXTexHandle mStagingTexture; ///< Texture used by openvr
 56
 57   LinearColorF mOverlayColor;
 58
 59   bool mOverlayTypeDirty; ///< Overlay type is dirty
 60   bool mOverlayDirty; ///< Overlay properties are dirty
 61   bool mManualMouseHandling;
 62   OverlayType mOverlayType;
 63
 64   //
 65
 66   OpenVROverlay();
 67   virtual ~OpenVROverlay();
 68
 69   static void initPersistFields();
 70
 71   DECLARE_CONOBJECT(OpenVROverlay);
 72
 73   bool onAdd();
 74   void onRemove();
 75
 76   void resetOverlay();
 77   void updateOverlay();
 78
 79   void showOverlay();
 80   void hideOverlay();
 81
 82   bool isOverlayVisible();
 83   bool isOverlayHoverTarget();
 84
 85   bool isGamepadFocussed();
 86   bool isActiveDashboardOverlay();
 87
 88   MatrixF getTransformForOverlayCoordinates(const Point2F &pos);
 89   bool castRay(const Point3F &origin, const Point3F &direction, RayInfo *info);
 90
 91   void moveGamepadFocusToNeighbour();
 92
 93   void handleOpenVREvents();
 94   void updateTextControl(GuiControl* ctrl);
 95   void onFrameRendered();
 96
 97   virtual void enableKeyboardTranslation();
 98   virtual void disableKeyboardTranslation();
 99   virtual void setNativeAcceleratorsEnabled(bool enabled);
100};
101
102typedef OpenVROverlay::OverlayType OpenVROverlayType;
103DefineEnumType(OpenVROverlayType);
104
105
106#endif
107