VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtVirtualRealityDriver Class Reference

A driver that manages virtual reality HMD and input devices. More...

Inheritance diagram for makVrv::DtVirtualRealityDriver:
Inheritance graph
[legend]

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 DtSubmitOverlayCallbackfindOverlayCallback ()
 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 DtOsgChannelfindEyeChannel (DtEye whichEye)
 get an eye channel. This will return null if the driver is not started
virtual DtObserverfindHmdObserver () 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.
DtAgentManageragentManager ()
 Get the master scene for this host.
virtual DtAgentManagerInterfacesceneInterface ()
 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::DtOsgChannelcreateEyeChannel (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

DtDemyDe
vr::IVRSystem * myVrSystem
vr::TrackedDevicePose_t * myTrackedPoses
DtObservermyHmdObserver
DtOsgChannelmyLeftEyeChannel
DtOsgChannelmyRightEyeChannel
DtWindowmyHmdWindow
osg::ref_ptr< osg::Texture2D > myOverlayTexture
osg::ref_ptr< osg::Texture2D > myOverlayDepthTexture
osg::ref_ptr
< DtSubmitOverlayCallback
myOverlaySubmitCallback
makArchives::DtVirtualRealitySettingsRecord::DtMirroring myMirroring
std::string myMirrorChannelName
DtOsgChannelmyMirrorChannel
osg::ref_ptr< osg::Texture2D > myMirrorTexture
std::string myMirrorObserverRestore
DtSignalConnectionManager myConnections
- Protected Attributes inherited from makVrv::DtDriver
DtAgentManagermyAgentManager
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
DtVirtualRealityDriveroperator= (const DtVirtualRealityDriver &)
 prevent assignment

Detailed Description

A driver that manages virtual reality HMD and input devices.

Member Enumeration Documentation

Enumerator:
Left 
Right 

Constructor & Destructor Documentation

makVrv::DtVirtualRealityDriver::DtVirtualRealityDriver ( )
private

prevent default constructor

makVrv::DtVirtualRealityDriver::DtVirtualRealityDriver ( const DtVirtualRealityDriver orig)
private

prevent copy construction

makVrv::DtVirtualRealityDriver::DtVirtualRealityDriver ( DtAgentManager am)

CTOR.

virtual makVrv::DtVirtualRealityDriver::~DtVirtualRealityDriver ( )
virtual

DTOR.

Member Function Documentation

DtVirtualRealityDriver& makVrv::DtVirtualRealityDriver::operator= ( const DtVirtualRealityDriver )
private

prevent assignment

virtual const std::string& makVrv::DtVirtualRealityDriver::className ( ) const
virtual

name of this driver. Returns "DtVirtualRealityDriver"

Implements makVrv::DtDriver.

virtual bool makVrv::DtVirtualRealityDriver::onStart ( )
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 bool makVrv::DtVirtualRealityDriver::onStop ( )
virtual

Stops the VR system and destroys the HMD window/channels and stops rendering to the HMD.

Implements makVrv::DtDriver.

virtual bool makVrv::DtVirtualRealityDriver::onTick ( )
virtual

Ticks the VR system and updates the position/orientation of the HMD and controllers.

Implements makVrv::DtDriver.

static bool makVrv::DtVirtualRealityDriver::isVrAvailable ( )
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 void makVrv::DtVirtualRealityDriver::resetHmd ( )
virtual

Resets the sitting position of HMD.

virtual void makVrv::DtVirtualRealityDriver::setMirroring ( makArchives::DtVirtualRealitySettingsRecord::DtMirroring  val)
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 makArchives::DtVirtualRealitySettingsRecord::DtMirroring makVrv::DtVirtualRealityDriver::mirroring ( ) const
virtual

Get the current state of mirroring the HMD to a monitor.

virtual void makVrv::DtVirtualRealityDriver::setMirrorChannel ( std::string  val)
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 osg::Texture2D* makVrv::DtVirtualRealityDriver::findMirrorTexture ( ) const
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 void makVrv::DtVirtualRealityDriver::setMirrorTexture ( makArchives::DtVirtualRealitySettingsRecord::DtMirroring  eye,
osg::Texture2D *  tex 
)
virtual

Set the texture to use fom the mirror channel.

This is intended to only be used by the VR post processor.

virtual DtSubmitOverlayCallback* makVrv::DtVirtualRealityDriver::findOverlayCallback ( )
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 bool makVrv::DtVirtualRealityDriver::getHmdPose ( DtVector pos,
DtQuat ori 
) const
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 DtOsgChannel* makVrv::DtVirtualRealityDriver::findEyeChannel ( DtEye  whichEye)
virtual

get an eye channel. This will return null if the driver is not started

virtual DtObserver* makVrv::DtVirtualRealityDriver::findHmdObserver ( ) const
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 void makVrv::DtVirtualRealityDriver::setObserverForHmd ( const std::string &  obsName)
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 vr::IVRSystem* makVrv::DtVirtualRealityDriver::findVrSystem ( ) const
virtual

returns the VR subsystem pointer. May return 0 if the VR system is not initialized

virtual void makVrv::DtVirtualRealityDriver::createHmdWindow ( DtDisplayConfiguration prototypeConfig)
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.

virtual makVrv::DtOsgChannel* makVrv::DtVirtualRealityDriver::createEyeChannel ( int  eye,
DtDisplayConfiguration prototypeConfig 
)
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.

virtual void makVrv::DtVirtualRealityDriver::initializeOverlay ( DtOsgChannel channel)
protectedvirtual

initialize an the overlay of a given channel to be displayed in the HMD

virtual void makVrv::DtVirtualRealityDriver::uninstallOverlay ( DtOsgChannel channel)
protectedvirtual

uninstall the overlay callbacks that draw the channel's overlay in the HMD

void makVrv::DtVirtualRealityDriver::installResetKeyMap ( )
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.

virtual void makVrv::DtVirtualRealityDriver::handleEnabledChanged ( bool  val)
protectedvirtual

callback for enabling/disabling VR.

virtual void makVrv::DtVirtualRealityDriver::handleObserverLost ( DtObserver obs)
protectedvirtual

callback for enabling/disabling VR.

virtual void makVrv::DtVirtualRealityDriver::updateMirroring ( makArchives::DtVirtualRealitySettingsRecord::DtMirroring  mirrorType,
std::string  channelName 
)
protectedvirtual

Update the mirror texture to be displayed on a channel, or turn it off.

virtual bool makVrv::DtVirtualRealityDriver::getPose ( osg::Vec3d &  position,
osg::Quat &  orienation,
int  index 
) const
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

virtual void makVrv::DtVirtualRealityDriver::updatePoseInformation ( )
protectedvirtual

called to update the pose information from the VR system

Member Data Documentation

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.

DtDe& makVrv::DtVirtualRealityDriver::myDe
protected
vr::IVRSystem* makVrv::DtVirtualRealityDriver::myVrSystem
protected
vr::TrackedDevicePose_t* makVrv::DtVirtualRealityDriver::myTrackedPoses
protected
DtObserver* makVrv::DtVirtualRealityDriver::myHmdObserver
protected
DtOsgChannel* makVrv::DtVirtualRealityDriver::myLeftEyeChannel
protected
DtOsgChannel* makVrv::DtVirtualRealityDriver::myRightEyeChannel
protected
DtWindow* makVrv::DtVirtualRealityDriver::myHmdWindow
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtVirtualRealityDriver::myOverlayTexture
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtVirtualRealityDriver::myOverlayDepthTexture
protected
osg::ref_ptr<DtSubmitOverlayCallback> makVrv::DtVirtualRealityDriver::myOverlaySubmitCallback
protected
makArchives::DtVirtualRealitySettingsRecord::DtMirroring makVrv::DtVirtualRealityDriver::myMirroring
protected
std::string makVrv::DtVirtualRealityDriver::myMirrorChannelName
protected
DtOsgChannel* makVrv::DtVirtualRealityDriver::myMirrorChannel
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtVirtualRealityDriver::myMirrorTexture
protected
std::string makVrv::DtVirtualRealityDriver::myMirrorObserverRestore
protected
DtSignalConnectionManager makVrv::DtVirtualRealityDriver::myConnections
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)