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

A driver that manages virtual reality HMD and input devices.

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

Public Member Functions

 DtVirtualRealityDriver (DtAgentManager &am)
 
virtual ~DtVirtualRealityDriver ()
 
virtual const std::string & className () const
 
virtual bool onStart ()
 
virtual bool onStop ()
 
virtual bool onTick ()
 
virtual bool isVrAvailable ()
 
virtual
vrvVirtualReality::DtVrRenderMode 
renderMode () const
 
virtual void resetHmd ()
 
virtual void triggerAction1 ()
 
virtual void setMirroring (makArchives::DtVirtualRealitySettingsRecord::DtMirroring val)
 
virtual
makArchives::DtVirtualRealitySettingsRecord::DtMirroring 
mirroring () const
 
virtual void setMirrorChannel (const std::string &val)
 
virtual DtSubmitOverlayCallbackfindOverlayCallback ()
 
virtual bool getHmdPose (DtVector &pos, DtQuat &ori) const
 
virtual DtVirtualRealityChannelfindEyeChannel (vrvVirtualReality::DtEye whichEye)
 
virtual DtOsgChannelfindMirrorChannel ()
 
virtual DtObserverfindHmdObserver () const
 
virtual void setObserverForHmd (const std::string &obsName)
 
void handleEnableMixedRealityChanged (bool val)
 
void handleEnableRealWorldDepthTestingChanged (bool val)
 
virtual void setProvider (DtVirtualRealityProvider *provider)
 
virtual DtVirtualRealityProviderfindProvider () const
 
virtual osg::Texture * findOverlayTexture () const
 
virtual DtOsgChannelfindOverlayChannel ()
 
virtual void initializeOverlay (DtOsgChannel *channel)
 
virtual void installMixedRealityMaskingObject (osg::Group *mountTo, osg::Vec3 offset, bool followObserver, const std::string &modelFileOrShapeName)
 
virtual void uninstallMixedRealityMaskingObject ()
 
virtual void startMasking ()
 
virtual void stopMasking ()
 
virtual void setOrientationSmoothingEnabled (bool enabled)
 
virtual void setOrientationSmoothingParams (double alpha, double threshold)
 
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 
virtual ~DtDriver ()
 
virtual void realizeConfiguration (const DtConfiguration &configuration)
 
virtual DtConfiguration createConfiguration () const
 
DtAgentManageragentManager ()
 
virtual DtAgentManagerInterfacesceneInterface ()
 
bool started () const
 
virtual const std::string & instanceName () const
 
virtual bool autoStart () const
 
virtual void setAutoStart (bool autoStart)
 
virtual bool isWindowDependent () const
 
virtual void setIsWindowDependent (bool dep)
 
virtual void setIsUserControllable (bool)
 
virtual bool isUserControllable () const
 
virtual void setIsPersistent (bool per)
 
virtual bool isPersistent () const
 
virtual bool isOnDriverSelectionList () const
 
virtual void setOnDriverSelectionList (bool)
 
bool objectFromAgentManager (const DtUniqueID &id) const
 

Public Attributes

boost::signalslib::signal< void()> signal_tick
 
boost::signalslib::signal< void()> signal_reset
 
boost::signalslib::signal
< void(bool)> 
signal_vrRunningChaned
 
boost::signalslib::signal< void()> signal_vrResolutionChanged
 
boost::signalslib::signal< void()> signal_vrOverlayChanged
 

Protected Types

typedef std::map
< vrvVirtualReality::DtEye,
DtVirtualRealityChannel * > 
DtVrEyeToChannelMap
 

Protected Member Functions

virtual DtOsgWindowfindHmdWindow ()
 
virtual DtVirtualRealityChannelcreateEyeChannel (vrvVirtualReality::DtEye eye, DtDisplayConfiguration *prototypeConfig)
 
virtual void installMultiViewShadersForChannel (DtVirtualRealityChannel *vrChannel)
 
virtual void uninstallOverlay (DtOsgChannel *channel)
 
virtual void handleOverlayDimensionsChanged (float val)
 
virtual void handleResolutionScaleChanged (int scale)
 
virtual void handleEnableVRSChanged (bool enable)
 
void installResetKeyMap ()
 
void installAction1KeyMap ()
 
virtual void handleEnabledChanged (bool val)
 
virtual void handleObserverLost (DtObserver *obs)
 
virtual void updateMirroring (makArchives::DtVirtualRealitySettingsRecord::DtMirroring mirrorType, const std::string &channelName)
 
virtual bool getPose (DtVector &position, DtQuat &orienation, int index) const
 
virtual void updatePoseInformation ()
 
void slot_channelDestroyed (DtChannelManager *channelManager, DtChannel *channel)
 
void slot_windowToBeDestroyed (DtWindow *window)
 
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 
void reportElementDestroyed (DtElementID id)
 
void start ()
 
void stop ()
 
bool tick ()
 
virtual void slot_displayEngineAdded (const DtDeRecord &igRecord)
 
virtual void setInstanceName (const std::string &name)
 
virtual void installAccessories ()
 
virtual void uninstallAccessories ()
 

Protected Attributes

DtDemyDe
 
DtVirtualRealityProvidermyVrProvider
 
DtObservermyHmdObserver
 
DtOsgWindowmyHmdWindow
 
DtWindowConfiguration myHmdWindowConfig
 
DtVrEyeToChannelMap myChannels
 
vrvVirtualReality::DtVrRenderMode myRenderMode
 
bool myUseMixedRealityMask
 
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
 
std::string myMirrorObserverRestore
 
DtVirtualRealityChannelmyStereoOverlayChannel
 
osg::ref_ptr
< osg::MatrixTransform > 
myOverlayQuad
 
bool myOriSmoothingEnabled
 
double myOriFilterAlpha
 
double myOriFilterThreshold
 
bool myOriSmoothingInit
 
osg::Quat mySmoothedOri
 
osg::Quat myLastHmdOri
 
double myLastTime
 
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 ()
 
 DtVirtualRealityDriver (const DtVirtualRealityDriver &orig)
 
DtVirtualRealityDriveroperator= (const DtVirtualRealityDriver &)
 

Member Typedef Documentation

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.

virtual bool makVrv::DtVirtualRealityDriver::isVrAvailable ( )
virtual

if VR is avialable

virtual vrvVirtualReality::DtVrRenderMode makVrv::DtVirtualRealityDriver::renderMode ( ) const
virtual

return the render mode being used

virtual void makVrv::DtVirtualRealityDriver::resetHmd ( )
virtual

Resets the sitting position of HMD.

virtual void makVrv::DtVirtualRealityDriver::triggerAction1 ( )
virtual

trigger generic action for the provider

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 ( const 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 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 DtVirtualRealityChannel* makVrv::DtVirtualRealityDriver::findEyeChannel ( vrvVirtualReality::DtEye  whichEye)
virtual

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

virtual DtOsgChannel* makVrv::DtVirtualRealityDriver::findMirrorChannel ( )
virtual

get the mirror channel. This will return null if the driver has 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.

void makVrv::DtVirtualRealityDriver::handleEnableMixedRealityChanged ( bool  val)

handle changing the enable mixed reality mask setting

void makVrv::DtVirtualRealityDriver::handleEnableRealWorldDepthTestingChanged ( bool  val)

handle changing the enable real world depth testing setting

virtual void makVrv::DtVirtualRealityDriver::setProvider ( DtVirtualRealityProvider provider)
virtual

set thes provider used by the driver for communicating with the virtual reality device

virtual DtVirtualRealityProvider* makVrv::DtVirtualRealityDriver::findProvider ( ) const
virtual

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

virtual osg::Texture* makVrv::DtVirtualRealityDriver::findOverlayTexture ( ) const
virtual

returns the overlay texture to optionally display in the mirror channel

virtual DtOsgChannel* makVrv::DtVirtualRealityDriver::findOverlayChannel ( )
virtual

returns the channel which has it's overlay camera active and rendering, left eye or multiview eye in multiview mode

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

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

virtual void makVrv::DtVirtualRealityDriver::installMixedRealityMaskingObject ( osg::Group *  mountTo,
osg::Vec3  offset,
bool  followObserver,
const std::string &  modelFileOrShapeName 
)
virtual

create and add a mixed reality masking object into the scene

virtual void makVrv::DtVirtualRealityDriver::uninstallMixedRealityMaskingObject ( )
virtual

unistall mixed reality masking object and delete

virtual void makVrv::DtVirtualRealityDriver::startMasking ( )
virtual

start masking, causes the mask to render and position to be updated

virtual void makVrv::DtVirtualRealityDriver::stopMasking ( )
virtual

stop masking, causes the mask to be remove and stops position updates

virtual void makVrv::DtVirtualRealityDriver::setOrientationSmoothingEnabled ( bool  enabled)
virtual

enable/disable smoothing of the hmd orientation

virtual void makVrv::DtVirtualRealityDriver::setOrientationSmoothingParams ( double  alpha,
double  threshold 
)
virtual

set the smoothing alpha and threshold for hmd orienation smoothing

virtual DtOsgWindow* makVrv::DtVirtualRealityDriver::findHmdWindow ( )
protectedvirtual

find a window for the HMD channels to live in.

virtual DtVirtualRealityChannel* makVrv::DtVirtualRealityDriver::createEyeChannel ( vrvVirtualReality::DtEye  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::installMultiViewShadersForChannel ( DtVirtualRealityChannel vrChannel)
protectedvirtual

install virtual program shaders and uniforms for the channel

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

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

virtual void makVrv::DtVirtualRealityDriver::handleOverlayDimensionsChanged ( float  val)
protectedvirtual

handle the overlay dimensions changing (width, aspect, distance)

virtual void makVrv::DtVirtualRealityDriver::handleResolutionScaleChanged ( int  scale)
protectedvirtual

handle the resolution scale changing

virtual void makVrv::DtVirtualRealityDriver::handleEnableVRSChanged ( bool  enable)
protectedvirtual

handle the VRS enable state changing

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.

void makVrv::DtVirtualRealityDriver::installAction1KeyMap ( )
protected

register VR action1 function with key map manager and bind to f9 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,
const std::string &  channelName 
)
protectedvirtual

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

virtual bool makVrv::DtVirtualRealityDriver::getPose ( DtVector position,
DtQuat 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 the HMD is always index 0.

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

called to update the pose information from the VR system

void makVrv::DtVirtualRealityDriver::slot_channelDestroyed ( DtChannelManager channelManager,
DtChannel channel 
)
protected

, listen for channel destroyed in case the mirror channel is destroyed

void makVrv::DtVirtualRealityDriver::slot_windowToBeDestroyed ( DtWindow window)
protected

Listen for window destroyed in case the VR window is destroyed.

Member Data Documentation

boost::signalslib::signal<void()> makVrv::DtVirtualRealityDriver::signal_tick

Signal emitted after the driver's tick. Useful for doing anything with the VR system that needs to happen every frame when VR is active.

boost::signalslib::signal<void()> makVrv::DtVirtualRealityDriver::signal_reset

Signal emitted when the VR system is reset.

boost::signalslib::signal<void(bool)> makVrv::DtVirtualRealityDriver::signal_vrRunningChaned

Signal emitted when the VR system is started or stoped.

boost::signalslib::signal<void()> makVrv::DtVirtualRealityDriver::signal_vrResolutionChanged

Signal emitted when the resolution changes.

boost::signalslib::signal<void()> makVrv::DtVirtualRealityDriver::signal_vrOverlayChanged

Signal emitted when the overlay dimensions change.

DtDe& makVrv::DtVirtualRealityDriver::myDe
protected
DtVirtualRealityProvider* makVrv::DtVirtualRealityDriver::myVrProvider
protected
DtObserver* makVrv::DtVirtualRealityDriver::myHmdObserver
protected
DtOsgWindow* makVrv::DtVirtualRealityDriver::myHmdWindow
protected
DtWindowConfiguration makVrv::DtVirtualRealityDriver::myHmdWindowConfig
protected
DtVrEyeToChannelMap makVrv::DtVirtualRealityDriver::myChannels
protected
vrvVirtualReality::DtVrRenderMode makVrv::DtVirtualRealityDriver::myRenderMode
protected
bool makVrv::DtVirtualRealityDriver::myUseMixedRealityMask
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
std::string makVrv::DtVirtualRealityDriver::myMirrorObserverRestore
protected
DtVirtualRealityChannel* makVrv::DtVirtualRealityDriver::myStereoOverlayChannel
protected
osg::ref_ptr<osg::MatrixTransform> makVrv::DtVirtualRealityDriver::myOverlayQuad
protected
bool makVrv::DtVirtualRealityDriver::myOriSmoothingEnabled
protected
double makVrv::DtVirtualRealityDriver::myOriFilterAlpha
protected
double makVrv::DtVirtualRealityDriver::myOriFilterThreshold
protected
bool makVrv::DtVirtualRealityDriver::myOriSmoothingInit
protected
osg::Quat makVrv::DtVirtualRealityDriver::mySmoothedOri
protected
osg::Quat makVrv::DtVirtualRealityDriver::myLastHmdOri
protected
double makVrv::DtVirtualRealityDriver::myLastTime
protected
DtSignalConnectionManager makVrv::DtVirtualRealityDriver::myConnections
protected

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

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)