VR-Forces 4.8 Class Documentation
 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. More...

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

Public Member Functions

 DtVirtualRealityDriver (DtAgentManager &am)
 CTOR. More...
 
virtual ~DtVirtualRealityDriver ()
 DTOR. More...
 
virtual const std::string & className () const
 name of this driver. Returns "DtVirtualRealityDriver" More...
 
virtual bool onStart ()
 Starts the VR system and creates an HMD window/channels and begins rendering to the HMD. More...
 
virtual bool onStop ()
 Stops the VR system and destroys the HMD window/channels and stops rendering to the HMD. More...
 
virtual bool onTick ()
 Ticks the VR system and updates the position/orientation of the HMD and controllers. More...
 
virtual bool isVrAvailable ()
 if VR is avialable More...
 
virtual bool isUsingMultiView () const
 is multi view vr enabled More...
 
virtual
vrvVirtualReality::DtVrRenderMode 
renderMode () const
 return the render mode being used More...
 
virtual void resetHmd ()
 Resets the sitting position of HMD. More...
 
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. More...
 
virtual
makArchives::DtVirtualRealitySettingsRecord::DtMirroring 
mirroring () const
 Get the current state of mirroring the HMD to a monitor. More...
 
virtual void setMirrorChannel (const std::string &val)
 Sets the display channel using a window and channel name (i.e. More...
 
virtual osg::Texture * findMirrorTexture () const
 If mirroring is enabled, retrieve the texture that the HMD is drawing to and that is being displayed on a monitor. More...
 
virtual void setMirrorTexture (makArchives::DtVirtualRealitySettingsRecord::DtMirroring eye, osg::Texture *tex)
 Set the texture to use fom the mirror channel. More...
 
virtual DtSubmitOverlayCallbackfindOverlayCallback ()
 Get the overlay callback that will called to display an overlay. More...
 
virtual bool getHmdPose (DtVector &pos, DtQuat &ori) const
 Get the HMD position relative to the HMD Observer in an East-North-Up coordinate system. More...
 
virtual DtVirtualRealityChannelfindEyeChannel (vrvVirtualReality::DtEye whichEye)
 get an eye channel. This will return null if the driver has not started More...
 
virtual DtOsgChannelfindMirrorChannel ()
 get the mirror channel. This will return null if the driver has not started More...
 
virtual DtObserverfindHmdObserver () const
 Get the HMD Observer that represents the Head of the VR system. More...
 
virtual void setObserverForHmd (const std::string &obsName)
 instead of using the default HMD observer, use another existing observer. More...
 
void handleUseMultiViewChanged (bool val)
 handle changing of multiview usage More...
 
virtual void setProvider (DtVirtualRealityProvider *provider)
 set thes provider used by the driver for communicating with the virtual reality device More...
 
virtual DtVirtualRealityProviderfindProvider () const
 returns the VR subsystem pointer. May return 0 if the VR system is not initialized More...
 
virtual osg::Texture * findOverlayTexture () const
 returns the overlay texture to optionally display in the mirror channel More...
 
virtual void installMixedRealityMaskingObject (osg::Group *mountTo, osg::Vec3 offset, bool followObserver, std::string modelFileOrShapeName)
 create and add a mixed reality masking object into the scene More...
 
virtual void uninstallMixedRealityMaskingObject ()
 unistall mixed reality masking object and delete More...
 
virtual void startMasking ()
 start masking, causes the mask to render and position to be updated More...
 
virtual void stopMasking ()
 stop masking, causes the mask to be remove and stops position updates More...
 
- Public Member Functions inherited from makVrv::DtDriver
 DtDriver (DtAgentManager &agentManager, const std::string &instanceName)
 CTOR. More...
 
virtual ~DtDriver ()
 DTOR. More...
 
virtual void realizeConfiguration (const DtConfiguration &configuration)
 Realize the driver using the configuration. More...
 
virtual DtConfiguration createConfiguration () const
 Create a configuration for the driver. More...
 
DtAgentManageragentManager ()
 Get the master scene for this host. More...
 
virtual DtAgentManagerInterfacesceneInterface ()
 Get the scene manager interface for creating agents. More...
 
bool started () const
 Get this driver's active state. More...
 
virtual const std::string & instanceName () const
 Get this driver's instance name. More...
 
virtual bool autoStart () const
 Get whether this driver is set to automatically start if it is persistent. More...
 
virtual void setAutoStart (bool autoStart)
 Set whether this driver automatically starts if it is persistent. More...
 
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. More...
 
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. More...
 
virtual void setIsUserControllable (bool)
 Set whether this driver can be started and stopped by the user. More...
 
virtual bool isUserControllable () const
 Get whether this driver can be started and stopped by the user. More...
 
virtual void setIsPersistent (bool per)
 Set if the driver is persistent and should be saved between runs. More...
 
virtual bool isPersistent () const
 Get if the driver is persistent and should be saved between runs. More...
 
virtual bool isOnDriverSelectionList () const
 Returns whether or not this driver is to be automatically started/stopped from the driver selection list. More...
 
virtual void setOnDriverSelectionList (bool)
 Sets whether or not this item is on the driver selection list. More...
 
bool objectFromAgentManager (const DtUniqueID &id) const
 check to see if the object was created using this driver's agent manager. More...
 

Public Attributes

boost::signal< void()> signal_tick
 Signal emitted after the driver's tick. More...
 
boost::signal< void()> signal_reset
 Signal emitted when the VR system is reset. More...
 

Protected Types

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

Protected Member Functions

virtual DtOsgWindowfindHmdWindow ()
 find a window for the HMD channels to live in. More...
 
virtual DtVirtualRealityChannelcreateEyeChannel (vrvVirtualReality::DtEye eye, DtDisplayConfiguration *prototypeConfig)
 Create a channel for the given eye of an HMD. More...
 
virtual void installMultiViewShadersForChannel (DtVirtualRealityChannel *vrChannel)
 install virtual program shaders and uniforms for the channel More...
 
virtual void initializeOverlay (DtOsgChannel *channel)
 initialize an the overlay of a given channel to be displayed in the HMD More...
 
virtual void uninstallOverlay (DtOsgChannel *channel)
 uninstall the overlay callbacks that draw the channel's overlay in the HMD More...
 
void installResetKeyMap ()
 register reset function with key map manager and bind to keypad minus key if available. More...
 
virtual void handleEnabledChanged (bool val)
 callback for enabling/disabling VR. More...
 
virtual void handleObserverLost (DtObserver *obs)
 callback for enabling/disabling VR. More...
 
virtual void multiViewIncompatibleRenderStateChanged (bool enabled)
 callback when a render state incompatible with multiview vr is enabled/disabled so we can toggle VR modes appropriately More...
 
virtual bool evaluateMultiViewSupport ()
 returns true if the multivew extension is supported and all incompatible render states are disabled. More...
 
virtual void updateMirroring (makArchives::DtVirtualRealitySettingsRecord::DtMirroring mirrorType, const std::string &channelName)
 Update the mirror texture to be displayed on a channel, or turn it off. More...
 
virtual bool getPose (DtVector &position, DtQuat &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 the HMD is always index 0. More...
 
virtual void updatePoseInformation ()
 called to update the pose information from the VR system More...
 
- Protected Member Functions inherited from makVrv::DtDriver
void applyChangesAndDelete (DtElementChanges *changes)
 Function for apply changes from a changes object and deleting it. More...
 
void reportElementCreated (DtElementID id, DtElementID parentId, DtElementEntry::ElementType type)
 Report an element created. More...
 
void reportElementAttribute (DtElementID id, DtElementAttribute *attribute)
 Report an element attribute changed. More...
 
void reportElementDestroyed (DtElementID id)
 Report an element destroyed. More...
 
void start ()
 Start the driver. More...
 
void stop ()
 Stop the driver. More...
 
bool tick ()
 Tick the host driver. More...
 
virtual void slot_displayEngineAdded (const DtDeRecord &igRecord)
 Called when a display engine is added. More...
 
virtual void setInstanceName (const std::string &name)
 set the Instance name. More...
 
virtual void installAccessories ()
 Installs accessories on this driver. More...
 
virtual void uninstallAccessories ()
 Removes accessories from this driver. More...
 

Protected Attributes

DtDemyDe
 
DtVirtualRealityProvidermyVrProvider
 
DtObservermyHmdObserver
 
DtOsgWindowmyHmdWindow
 
DtVrEyeToChannelMap myChannels
 
bool myUseMultiView
 
bool myHasFocusView
 
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
 
osg::ref_ptr< osg::Texture > 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 More...
 
 DtVirtualRealityDriver (const DtVirtualRealityDriver &orig)
 prevent copy construction More...
 
DtVirtualRealityDriveroperator= (const DtVirtualRealityDriver &)
 prevent assignment More...
 

Detailed Description

A driver that manages virtual reality HMD and input devices.

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 bool makVrv::DtVirtualRealityDriver::isUsingMultiView ( ) const
virtual

is multi view vr enabled

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::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 osg::Texture* 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::Texture *  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 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::handleUseMultiViewChanged ( bool  val)

handle changing of multiview usage

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 void makVrv::DtVirtualRealityDriver::installMixedRealityMaskingObject ( osg::Group *  mountTo,
osg::Vec3  offset,
bool  followObserver,
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 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::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::multiViewIncompatibleRenderStateChanged ( bool  enabled)
protectedvirtual

callback when a render state incompatible with multiview vr is enabled/disabled so we can toggle VR modes appropriately

virtual bool makVrv::DtVirtualRealityDriver::evaluateMultiViewSupport ( )
protectedvirtual

returns true if the multivew extension is supported and all incompatible render states are disabled.

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

Member Data Documentation

boost::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::signal<void()> makVrv::DtVirtualRealityDriver::signal_reset

Signal emitted when the VR system is reset.

DtDe& makVrv::DtVirtualRealityDriver::myDe
protected
DtVirtualRealityProvider* makVrv::DtVirtualRealityDriver::myVrProvider
protected
DtObserver* makVrv::DtVirtualRealityDriver::myHmdObserver
protected
DtOsgWindow* makVrv::DtVirtualRealityDriver::myHmdWindow
protected
DtVrEyeToChannelMap makVrv::DtVirtualRealityDriver::myChannels
protected
bool makVrv::DtVirtualRealityDriver::myUseMultiView
protected
bool makVrv::DtVirtualRealityDriver::myHasFocusView
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
osg::ref_ptr<osg::Texture> 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 Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)