File indexing completed on 2025-01-18 10:02:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Aspect_OpenVRSession_HeaderFile
0015 #define _Aspect_OpenVRSession_HeaderFile
0016
0017 #include <Aspect_XRSession.hxx>
0018
0019
0020 class Aspect_OpenVRSession : public Aspect_XRSession
0021 {
0022 DEFINE_STANDARD_RTTIEXT(Aspect_OpenVRSession, Aspect_XRSession)
0023 public:
0024
0025
0026
0027 Standard_EXPORT static bool IsHmdPresent();
0028
0029 public:
0030
0031
0032 Standard_EXPORT Aspect_OpenVRSession();
0033
0034
0035 Standard_EXPORT virtual ~Aspect_OpenVRSession();
0036
0037
0038 Standard_EXPORT virtual bool IsOpen() const Standard_OVERRIDE;
0039
0040
0041 Standard_EXPORT virtual bool Open() Standard_OVERRIDE;
0042
0043
0044 Standard_EXPORT virtual void Close() Standard_OVERRIDE;
0045
0046
0047 Standard_EXPORT virtual bool WaitPoses() Standard_OVERRIDE;
0048
0049
0050 virtual NCollection_Vec2<int> RecommendedViewport() const Standard_OVERRIDE { return myRendSize; }
0051
0052
0053
0054 Standard_EXPORT virtual NCollection_Mat4<double> EyeToHeadTransform (Aspect_Eye theEye) const Standard_OVERRIDE;
0055
0056
0057 Standard_EXPORT virtual NCollection_Mat4<double> ProjectionMatrix (Aspect_Eye theEye,
0058 double theZNear,
0059 double theZFar) const Standard_OVERRIDE;
0060
0061
0062 virtual bool HasProjectionFrustums() const Standard_OVERRIDE { return true; }
0063
0064
0065 Standard_EXPORT virtual void ProcessEvents() Standard_OVERRIDE;
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 Standard_EXPORT virtual bool SubmitEye (void* theTexture,
0076 Aspect_GraphicsLibrary theGraphicsLib,
0077 Aspect_ColorSpace theColorSpace,
0078 Aspect_Eye theEye) Standard_OVERRIDE;
0079
0080
0081 Standard_EXPORT virtual TCollection_AsciiString GetString (InfoString theInfo) const Standard_OVERRIDE;
0082
0083
0084 Standard_EXPORT virtual Standard_Integer NamedTrackedDevice (Aspect_XRTrackedDeviceRole theDevice) const Standard_OVERRIDE;
0085
0086
0087 Standard_EXPORT virtual Aspect_XRDigitalActionData GetDigitalActionData (const Handle(Aspect_XRAction)& theAction) const Standard_OVERRIDE;
0088
0089
0090 Standard_EXPORT virtual Aspect_XRAnalogActionData GetAnalogActionData (const Handle(Aspect_XRAction)& theAction) const Standard_OVERRIDE;
0091
0092
0093 Standard_EXPORT virtual Aspect_XRPoseActionData GetPoseActionDataForNextFrame (const Handle(Aspect_XRAction)& theAction) const Standard_OVERRIDE;
0094
0095
0096 Standard_EXPORT virtual void SetTrackingOrigin (TrackingUniverseOrigin theOrigin) Standard_OVERRIDE;
0097
0098 protected:
0099
0100
0101 Standard_EXPORT TCollection_AsciiString defaultActionsManifest();
0102
0103
0104 Standard_EXPORT void closeVR();
0105
0106
0107 Standard_EXPORT virtual void updateProjectionFrustums();
0108
0109
0110 Standard_EXPORT virtual bool initInput();
0111
0112
0113 Standard_EXPORT virtual void onTrackedDeviceActivated (Standard_Integer theDeviceIndex);
0114
0115
0116 Standard_EXPORT virtual void onTrackedDeviceDeactivated (Standard_Integer theDeviceIndex);
0117
0118
0119 Standard_EXPORT virtual void onTrackedDeviceUpdated (Standard_Integer theDeviceIndex);
0120
0121
0122 Standard_EXPORT virtual void triggerHapticVibrationAction (const Handle(Aspect_XRAction)& theAction,
0123 const Aspect_XRHapticActionData& theParams) Standard_OVERRIDE;
0124
0125
0126 Standard_EXPORT virtual Handle(Graphic3d_ArrayOfTriangles) loadRenderModel (Standard_Integer theDevice,
0127 Standard_Boolean theToApplyUnitFactor,
0128 Handle(Image_Texture)& theTexture) Standard_OVERRIDE;
0129
0130 protected:
0131
0132
0133 Standard_EXPORT void* getVRSystem() const;
0134
0135 private:
0136
0137
0138 struct VRContext;
0139 class VRImagePixmap;
0140 class VRTextureSource;
0141
0142 protected:
0143
0144 VRContext* myContext;
0145 TCollection_AsciiString myActionsManifest;
0146
0147 };
0148
0149 #endif