![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
OpenVR wrapper implementing Aspect_XRSession interface. More...
#include <Aspect_OpenVRSession.hxx>

Public Member Functions | |
| Aspect_OpenVRSession () | |
| Empty constructor. | |
| ~Aspect_OpenVRSession () override | |
| Destructor. | |
| bool | IsOpen () const override |
| Return TRUE if session is opened. | |
| bool | Open () override |
| Initialize session. | |
| void | Close () override |
| Release session. | |
| bool | WaitPoses () override |
| Fetch actual poses of tracked devices. | |
| NCollection_Vec2< int > | RecommendedViewport () const override |
| Return recommended viewport Width x Height for rendering into VR. | |
| NCollection_Mat4< double > | EyeToHeadTransform (Aspect_Eye theEye) const override |
| Return transformation from eye to head. vr::GetEyeToHeadTransform() wrapper. | |
| NCollection_Mat4< double > | ProjectionMatrix (Aspect_Eye theEye, double theZNear, double theZFar) const override |
| Return projection matrix. | |
| bool | HasProjectionFrustums () const override |
| Return TRUE. | |
| void | ProcessEvents () override |
| Receive XR events. | |
| bool | SubmitEye (void *theTexture, Aspect_GraphicsLibrary theGraphicsLib, Aspect_ColorSpace theColorSpace, Aspect_Eye theEye) override |
| Submit texture eye to XR Composer. | |
| TCollection_AsciiString | GetString (InfoString theInfo) const override |
| Query information. | |
| int | NamedTrackedDevice (Aspect_XRTrackedDeviceRole theDevice) const override |
| Return index of tracked device of known role. | |
| Aspect_XRDigitalActionData | GetDigitalActionData (const occ::handle< Aspect_XRAction > &theAction) const override |
| Fetch data for digital input action (like button). | |
| Aspect_XRAnalogActionData | GetAnalogActionData (const occ::handle< Aspect_XRAction > &theAction) const override |
| Fetch data for analog input action (like axis). | |
| Aspect_XRPoseActionData | GetPoseActionDataForNextFrame (const occ::handle< Aspect_XRAction > &theAction) const override |
| Fetch data for pose input action (like fingertip position). | |
| void | SetTrackingOrigin (TrackingUniverseOrigin theOrigin) override |
| Set tracking origin. | |
Public Member Functions inherited from Aspect_XRSession | |
| NCollection_Mat4< double > | HeadToEyeTransform (Aspect_Eye theEye) const |
| Return transformation from head to eye. | |
| double | UnitFactor () const |
| Return unit scale factor defined as scale factor for m (meters); 1.0 by default. | |
| void | SetUnitFactor (double theFactor) |
| Set unit scale factor. | |
| double | Aspect () const |
| Return aspect ratio. | |
| double | FieldOfView () const |
| Return field of view. | |
| double | IOD () const |
| Return Intra-ocular Distance (IOD); also known as Interpupillary Distance (IPD). Defined in meters by default (. | |
| float | DisplayFrequency () const |
| Return display frequency or 0 if unknown. | |
| const Aspect_FrustumLRBT< double > & | ProjectionFrustum (Aspect_Eye theEye) const |
| Return projection frustum. | |
| const gp_Trsf & | HeadPose () const |
| Return head orientation in right-handed system: +y is up +x is to the right -z is forward Distance unit is meters by default (. | |
| gp_Trsf | LeftHandPose () const |
| Return left hand orientation. | |
| gp_Trsf | RightHandPose () const |
| Return right hand orientation. | |
| const NCollection_Array1< Aspect_TrackedDevicePose > & | TrackedPoses () const |
| Return number of tracked poses array. | |
| bool | HasTrackedPose (int theDevice) const |
| Return TRUE if device orientation is defined. | |
| occ::handle< Graphic3d_ArrayOfTriangles > | LoadRenderModel (int theDevice, occ::handle< Image_Texture > &theTexture) |
| Load model for displaying device. | |
| occ::handle< Graphic3d_ArrayOfTriangles > | LoadRenderModel (int theDevice, bool theToApplyUnitFactor, occ::handle< Image_Texture > &theTexture) |
| Load model for displaying device. | |
| void | TriggerHapticVibrationAction (const occ::handle< Aspect_XRAction > &theAction, const Aspect_XRHapticActionData &theParams) |
| Trigger vibration. | |
| void | AbortHapticVibrationAction (const occ::handle< Aspect_XRAction > &theAction) |
| Abort vibration. | |
| TrackingUniverseOrigin | TrackingOrigin () const |
| Return tracking origin. | |
| const occ::handle< Aspect_XRAction > & | GenericAction (Aspect_XRTrackedDeviceRole theDevice, Aspect_XRGenericAction theAction) const |
| Return generic action for specific hand or NULL if undefined. | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Static Public Member Functions | |
| static bool | IsHmdPresent () |
| Return TRUE if an HMD may be presented on the system (e.g. to show VR checkbox in application GUI). This is fast check, and even if it returns TRUE, opening session may fail. | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
Protected Member Functions | |
| TCollection_AsciiString | defaultActionsManifest () |
| Find location of default actions manifest file (based on CSF_OCCTResourcePath or CASROOT variables). | |
| void | closeVR () |
| Release OpenVR device. | |
| virtual void | updateProjectionFrustums () |
| Update projection frustums. | |
| virtual bool | initInput () |
| Init VR input. | |
| virtual void | onTrackedDeviceActivated (int theDeviceIndex) |
| Handle tracked device activation. | |
| virtual void | onTrackedDeviceDeactivated (int theDeviceIndex) |
| Handle tracked device deactivation. | |
| virtual void | onTrackedDeviceUpdated (int theDeviceIndex) |
| Handle tracked device update. | |
| void | triggerHapticVibrationAction (const occ::handle< Aspect_XRAction > &theAction, const Aspect_XRHapticActionData &theParams) override |
| Trigger vibration. | |
| occ::handle< Graphic3d_ArrayOfTriangles > | loadRenderModel (int theDevice, bool theToApplyUnitFactor, occ::handle< Image_Texture > &theTexture) override |
| Return model for displaying device. | |
| void * | getVRSystem () const |
| Access vr::IVRSystem* - OpenVR session object. | |
Protected Member Functions inherited from Aspect_XRSession | |
| Aspect_XRSession () | |
| Empty constructor. | |
Protected Attributes | |
| VRContext * | myContext |
| TCollection_AsciiString | myActionsManifest |
Protected Attributes inherited from Aspect_XRSession | |
| NCollection_Array1< occ::handle< Aspect_XRAction > > | myRoleActions [Aspect_XRTrackedDeviceRole_NB] |
| generic actions | |
| NCollection_IndexedDataMap< TCollection_AsciiString, occ::handle< Aspect_XRActionSet > > | myActionSets |
| actions sets | |
| TrackingUniverseOrigin | myTrackOrigin |
| tracking origin | |
| NCollection_Array1< Aspect_TrackedDevicePose > | myTrackedPoses |
| array of tracked poses | |
| gp_Trsf | myHeadPose |
| head orientation | |
| NCollection_Vec2< int > | myRendSize |
| viewport Width x Height for rendering into VR | |
| Aspect_FrustumLRBT< double > | myFrustumL |
| left eye projection frustum | |
| Aspect_FrustumLRBT< double > | myFrustumR |
| right eye projection frustum | |
| double | myUnitFactor |
| unit scale factor defined as scale factor for m (meters) | |
| double | myAspect |
| aspect ratio | |
| double | myFieldOfView |
| field of view | |
| double | myIod |
| intra-ocular distance in meters | |
| float | myDispFreq |
| display frequency | |
Additional Inherited Members | |
Public Types inherited from Aspect_XRSession | |
| enum | TrackingUniverseOrigin { TrackingUniverseOrigin_Seated , TrackingUniverseOrigin_Standing } |
| Identifies which style of tracking origin the application wants to use for the poses it is requesting. More... | |
| enum | InfoString { InfoString_Vendor , InfoString_Device , InfoString_Tracker , InfoString_SerialNumber } |
| Info string enumeration. More... | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
OpenVR wrapper implementing Aspect_XRSession interface.
| Aspect_OpenVRSession::Aspect_OpenVRSession | ( | ) |
Empty constructor.
|
override |
Destructor.
|
overridevirtual |
Release session.
Implements Aspect_XRSession.
|
protected |
Release OpenVR device.
|
protected |
Find location of default actions manifest file (based on CSF_OCCTResourcePath or CASROOT variables).
|
overridevirtual |
Return transformation from eye to head. vr::GetEyeToHeadTransform() wrapper.
Implements Aspect_XRSession.
|
overridevirtual |
Fetch data for analog input action (like axis).
Implements Aspect_XRSession.
|
overridevirtual |
Fetch data for digital input action (like button).
Implements Aspect_XRSession.
|
overridevirtual |
Fetch data for pose input action (like fingertip position).
Implements Aspect_XRSession.
|
overridevirtual |
Query information.
Implements Aspect_XRSession.
|
protected |
Access vr::IVRSystem* - OpenVR session object.
|
inlineoverridevirtual |
Return TRUE.
Implements Aspect_XRSession.
Return TRUE if an HMD may be presented on the system (e.g. to show VR checkbox in application GUI). This is fast check, and even if it returns TRUE, opening session may fail.
|
overridevirtual |
Return TRUE if session is opened.
Implements Aspect_XRSession.
|
overrideprotectedvirtual |
Return model for displaying device.
Implements Aspect_XRSession.
|
overridevirtual |
Return index of tracked device of known role.
Implements Aspect_XRSession.
Handle tracked device activation.
|
protectedvirtual |
Handle tracked device deactivation.
Handle tracked device update.
|
overridevirtual |
Initialize session.
Implements Aspect_XRSession.
|
overridevirtual |
Receive XR events.
Implements Aspect_XRSession.
|
overridevirtual |
Return projection matrix.
Implements Aspect_XRSession.
|
inlineoverridevirtual |
Return recommended viewport Width x Height for rendering into VR.
Implements Aspect_XRSession.
|
overridevirtual |
Set tracking origin.
Reimplemented from Aspect_XRSession.
|
overridevirtual |
Submit texture eye to XR Composer.
| [in] | theTexture | texture handle |
| [in] | theGraphicsLib | graphics library in which texture handle is defined |
| [in] | theColorSpace | texture color space; sRGB means no color conversion by composer; Linear means to sRGB color conversion by composer |
| [in] | theEye | eye to display |
Implements Aspect_XRSession.
|
overrideprotectedvirtual |
Trigger vibration.
Implements Aspect_XRSession.
Update projection frustums.
|
overridevirtual |
Fetch actual poses of tracked devices.
Implements Aspect_XRSession.
|
protected |
|
protected |