![]() |
VR-Forces 4.6 Class Documentation
|
A driver that manages virtual reality HMD and input devices. More...

Public Types | |
| enum | DtEye { Left, Right } |
Public Member Functions | |
| DtVirtualRealityDriver (DtAgentManager &am) | |
| CTOR. | |
| virtual | ~DtVirtualRealityDriver () |
| DTOR. | |
| virtual const std::string & | className () const |
| name of this driver. Returns "DtVirtualRealityDriver" | |
| virtual bool | onStart () |
| Starts the VR system and creates an HMD window/channels and begins rendering to the HMD. | |
| virtual bool | onStop () |
| Stops the VR system and destroys the HMD window/channels and stops rendering to the HMD. | |
| virtual bool | onTick () |
| Ticks the VR system and updates the position/orientation of the HMD and controllers. | |
| virtual void | resetHmd () |
| Resets the sitting position of HMD. | |
| virtual void | setMirroring (makArchives::DtVirtualRealitySettingsRecord::DtMirroring val) |
| Enables/disables mirroring of an HMD eye channel on a monitor so other people can see what the user of the HMD is seeing. | |
| virtual makArchives::DtVirtualRealitySettingsRecord::DtMirroring | mirroring () const |
| Get the current state of mirroring the HMD to a monitor. | |
| virtual void | setMirrorChannel (std::string val) |
| Sets the display channel using a window and channel name (i.e. | |
| virtual osg::Texture2D * | findMirrorTexture () const |
| If mirroring is enabled, retrieve the texture that the HMD is drawing to and that is being displayed on a monitor. | |
| virtual void | setMirrorTexture (makArchives::DtVirtualRealitySettingsRecord::DtMirroring eye, osg::Texture2D *tex) |
| Set the texture to use fom the mirror channel. | |
| virtual DtSubmitOverlayCallback * | findOverlayCallback () |
| Get the overlay callback that will called to display an overlay. | |
| virtual bool | getHmdPose (DtVector &pos, DtQuat &ori) const |
| Get the HMD position relative to the HMD Observer in an East-North-Up coordinate system. | |
| virtual DtOsgChannel * | findEyeChannel (DtEye whichEye) |
| get an eye channel. This will return null if the driver is not started | |
| virtual DtObserver * | findHmdObserver () const |
| Get the HMD Observer that represents the Head of the VR system. | |
| virtual void | setObserverForHmd (const std::string &obsName) |
| instead of using the default HMD observer, use another existing observer. | |
| virtual vr::IVRSystem * | findVrSystem () const |
| returns the VR subsystem pointer. May return 0 if the VR system is not initialized | |
Public Member Functions inherited from makVrv::DtDriver | |
| DtDriver (DtAgentManager &agentManager, const std::string &instanceName) | |
| CTOR. | |
| virtual | ~DtDriver () |
| DTOR. | |
| virtual void | realizeConfiguration (const DtConfiguration &configuration) |
| Realize the driver using the configuration. | |
| virtual DtConfiguration | createConfiguration () const |
| Create a configuration for the driver. | |
| DtAgentManager & | agentManager () |
| Get the master scene for this host. | |
| virtual DtAgentManagerInterface & | sceneInterface () |
| Get the scene manager interface for creating agents. | |
| bool | started () const |
| Get this driver's active state. | |
| virtual const std::string & | instanceName () const |
| Get this driver's instance name. | |
| virtual bool | autoStart () const |
| Get whether this driver is set to automatically start if it is persistent. | |
| virtual void | setAutoStart (bool autoStart) |
| Set whether this driver automatically starts if it is persistent. | |
| virtual bool | isWindowDependent () const |
| Get whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed. | |
| virtual void | setIsWindowDependent (bool dep) |
| Set whether this driver is set to automatically start when the first window is created and stop when the last window is destroyed. | |
| virtual void | setIsUserControllable (bool) |
| Set whether this driver can be started and stopped by the user. | |
| virtual bool | isUserControllable () const |
| Get whether this driver can be started and stopped by the user. | |
| virtual void | setIsPersistent (bool per) |
| Set if the driver is persistent and should be saved between runs. | |
| virtual bool | isPersistent () const |
| Get if the driver is persistent and should be saved between runs. | |
| virtual bool | isOnDriverSelectionList () const |
| Returns whether or not this driver is to be automatically started/stopped from the driver selection list. | |
| virtual void | setOnDriverSelectionList (bool) |
| Sets whether or not this item is on the driver selection list. | |
| bool | objectFromAgentManager (const DtUniqueID &id) const |
| check to see if the object was created using this driver's agent manager. | |
Static Public Member Functions | |
| static bool | isVrAvailable () |
| Detects whether or not an HMD device is attached and ready for use. | |
Public Attributes | |
| boost::signal< void()> | signal_postTick |
| Signal emitted after the driver's tick. | |
| boost::signal< void()> | signal_reset |
| Signal emitted when the VR system is reset. | |
Protected Member Functions | |
| virtual void | createHmdWindow (DtDisplayConfiguration *prototypeConfig) |
| create a window for the HMD channels to live in. | |
| virtual makVrv::DtOsgChannel * | createEyeChannel (int eye, DtDisplayConfiguration *prototypeConfig) |
| Create a channel for the given eye of an HMD. | |
| virtual void | initializeOverlay (DtOsgChannel *channel) |
| initialize an the overlay of a given channel to be displayed in the HMD | |
| virtual void | uninstallOverlay (DtOsgChannel *channel) |
| uninstall the overlay callbacks that draw the channel's overlay in the HMD | |
| void | installResetKeyMap () |
| register reset function with key map manager and bind to keypad minus key if available. | |
| virtual void | handleEnabledChanged (bool val) |
| callback for enabling/disabling VR. | |
| virtual void | handleObserverLost (DtObserver *obs) |
| callback for enabling/disabling VR. | |
| virtual void | updateMirroring (makArchives::DtVirtualRealitySettingsRecord::DtMirroring mirrorType, std::string channelName) |
| Update the mirror texture to be displayed on a channel, or turn it off. | |
| virtual bool | getPose (osg::Vec3d &position, osg::Quat &orienation, int index) const |
| get pose information for given object (HMD, controller, or tracker) if this fails to find the given object by index, it will return a zero vector and identity quat | |
| virtual void | updatePoseInformation () |
| called to update the pose information from the VR system | |
Protected Member Functions inherited from makVrv::DtDriver | |
| void | applyChangesAndDelete (DtElementChanges *changes) |
| Function for apply changes from a changes object and deleting it. | |
| void | reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type) |
| Report an element created. | |
| void | reportElementAttribute (DtElementID id, DtElementAttribute *attribute) |
| Report an element attribute changed. | |
| void | reportElementDestroyed (DtElementID id) |
| Report an element destroyed. | |
| void | start () |
| Start the driver. | |
| void | stop () |
| Stop the driver. | |
| bool | tick () |
| Tick the host driver. | |
| virtual void | slot_displayEngineAdded (const DtDeRecord &igRecord) |
| Called when a display engine is added. | |
| virtual void | setInstanceName (const std::string &name) |
| set the Instance name. | |
| virtual void | installAccessories () |
| Installs accessories on this driver. | |
| virtual void | uninstallAccessories () |
| Removes accessories from this driver. | |
Protected Attributes | |
| DtDe & | myDe |
| vr::IVRSystem * | myVrSystem |
| vr::TrackedDevicePose_t * | myTrackedPoses |
| DtObserver * | myHmdObserver |
| DtOsgChannel * | myLeftEyeChannel |
| DtOsgChannel * | myRightEyeChannel |
| DtWindow * | myHmdWindow |
| osg::ref_ptr< osg::Texture2D > | myOverlayTexture |
| osg::ref_ptr< osg::Texture2D > | myOverlayDepthTexture |
| osg::ref_ptr < DtSubmitOverlayCallback > | myOverlaySubmitCallback |
| makArchives::DtVirtualRealitySettingsRecord::DtMirroring | myMirroring |
| std::string | myMirrorChannelName |
| DtOsgChannel * | myMirrorChannel |
| osg::ref_ptr< osg::Texture2D > | myMirrorTexture |
| std::string | myMirrorObserverRestore |
| DtSignalConnectionManager | myConnections |
Protected Attributes inherited from makVrv::DtDriver | |
| DtAgentManager & | myAgentManager |
| bool | myStartedFlag |
| std::string | myName |
| DtConfiguration | myConfiguration |
| bool | myPersistentFlag |
| bool | myUserControllableFlag |
| bool | myRequestStateDiffPendingFlag |
| DtElementChanges | myChanges |
Private Member Functions | |
| DtVirtualRealityDriver () | |
| prevent default constructor | |
| DtVirtualRealityDriver (const DtVirtualRealityDriver &orig) | |
| prevent copy construction | |
| DtVirtualRealityDriver & | operator= (const DtVirtualRealityDriver &) |
| prevent assignment | |
A driver that manages virtual reality HMD and input devices.
|
private |
prevent default constructor
|
private |
prevent copy construction
| makVrv::DtVirtualRealityDriver::DtVirtualRealityDriver | ( | DtAgentManager & | am | ) |
CTOR.
|
virtual |
DTOR.
|
private |
prevent assignment
|
virtual |
name of this driver. Returns "DtVirtualRealityDriver"
Implements makVrv::DtDriver.
|
virtual |
Starts the VR system and creates an HMD window/channels and begins rendering to the HMD.
This will fail if an HMD is not present or cannot be initialized.
Implements makVrv::DtDriver.
|
virtual |
Stops the VR system and destroys the HMD window/channels and stops rendering to the HMD.
Implements makVrv::DtDriver.
|
virtual |
Ticks the VR system and updates the position/orientation of the HMD and controllers.
Implements makVrv::DtDriver.
|
static |
Detects whether or not an HMD device is attached and ready for use.
This may be called outside of the driver being started/stopped to check for the existence of any attached devices.
|
virtual |
Resets the sitting position of HMD.
|
virtual |
Enables/disables mirroring of an HMD eye channel on a monitor so other people can see what the user of the HMD is seeing.
|
virtual |
Get the current state of mirroring the HMD to a monitor.
|
virtual |
Sets the display channel using a window and channel name (i.e.
"Window 1:Channel 1") that will mirror what the HMD is seeing.
|
virtual |
If mirroring is enabled, retrieve the texture that the HMD is drawing to and that is being displayed on a monitor.
This may return 0 if mirroring is not enabled. This is intended to only be used by the VR post processor.
|
virtual |
Set the texture to use fom the mirror channel.
This is intended to only be used by the VR post processor.
|
virtual |
Get the overlay callback that will called to display an overlay.
This can be used to adjust the offset of the overlay window. This will return 0 if the driver is not started
|
virtual |
Get the HMD position relative to the HMD Observer in an East-North-Up coordinate system.
This will return false and a zero vector and identity quaternion if the HMD is not present
|
virtual |
get an eye channel. This will return null if the driver is not started
|
virtual |
Get the HMD Observer that represents the Head of the VR system.
This can return 0 if there is no HMD system or VR is not enabled.
|
virtual |
instead of using the default HMD observer, use another existing observer.
If the string "" or the observer cannot be found, then the default HMD Observer is used.
|
virtual |
returns the VR subsystem pointer. May return 0 if the VR system is not initialized
|
protectedvirtual |
create a window for the HMD channels to live in.
Takes an optional prototype display settings that will have an HMD_Window defined with settings otherwise defaults are used.
|
protectedvirtual |
Create a channel for the given eye of an HMD.
Takes an optional prototype display settings that will have an HMD_Window defined with settings otherwise defaults are used.
|
protectedvirtual |
initialize an the overlay of a given channel to be displayed in the HMD
|
protectedvirtual |
uninstall the overlay callbacks that draw the channel's overlay in the HMD
|
protected |
register reset function with key map manager and bind to keypad minus key if available.
If the key is not available, the user will need to manually bind to an available key.
|
protectedvirtual |
callback for enabling/disabling VR.
|
protectedvirtual |
callback for enabling/disabling VR.
|
protectedvirtual |
Update the mirror texture to be displayed on a channel, or turn it off.
|
protectedvirtual |
get pose information for given object (HMD, controller, or tracker) if this fails to find the given object by index, it will return a zero vector and identity quat
|
protectedvirtual |
called to update the pose information from the VR system
| boost::signal<void()> makVrv::DtVirtualRealityDriver::signal_postTick |
Signal emitted after the driver's tick.
Useful for doing anything with the VR system that needs to happen every frame when virtual reality is active.
| boost::signal<void()> makVrv::DtVirtualRealityDriver::signal_reset |
Signal emitted when the VR system is reset.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |