Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
G3D::XR Class Referenceabstract

Low-level eXtended Reality (AR/VR/MR) API base class, analogous to 2D GUI OSWindow for a VR system. More...

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::EmulatedXR, G3D::MonitorXR, and G3D::OpenVR.

Classes

class  Controller
 Wand with buttons and joysticks or equivalent. More...
 
class  Event
 We don't provide motion or button events because those are polled directly from the trackedObjectArray(). More...
 
class  Hand
 Tracked human hand. More...
 
class  HMD
 
Display attached to the head. More...
 
class  Object
 
class  Settings
 Reserved for future use. More...
 
class  TrackedVolume
 

Public Member Functions

virtual const StringclassName () const =0
 Which subclass of XR is this? More...
 
virtual void cleanup ()
 
const Array< shared_ptr< HMD > > & hmdArray () const
 
virtual shared_ptr< EventnextEvent ()
 Returns nullptr when out of events. More...
 
const Array< shared_ptr< Object > > & objectArray () const
 All tracked objects, including HMDs. More...
 
virtual void postGraphicsInit (const Settings &settings)
 
virtual void preGraphicsInit (const Settings &settings)
 
const TrackedVolumetrackedVolume () const
 
virtual void updateTrackingData ()=0
 Call once per frame. More...
 

Static Public Member Functions

static void setFrame (const shared_ptr< Object > &t, const CFrame &f, const CFrame &p)
 Allows XR subclasses to access protected variables inside a tracked object. More...
 

Protected Member Functions

 XR ()
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

Queue< shared_ptr< XR::Event > > m_eventQueue
 
Array< shared_ptr< HMD > > m_hmdArray
 
Array< shared_ptr< Object > > m_objectArray
 
TrackedVolume m_trackedVolume
 

Detailed Description

Low-level eXtended Reality (AR/VR/MR) API base class, analogous to 2D GUI OSWindow for a VR system.

Subclasses should provide a static create() method which instantiates the object but performs no intialization (because the graphics context and other parts of the system will not be initialized themselves yet at instantiation time).

All coordinate frames are relative to the the TrackedVolume. See G3D::XRWidget for a high-level API that manages frames in world space.

See also
OpenVR, MonitorXR, XRWidget

Constructor & Destructor Documentation

◆ XR()

G3D::XR::XR ( )
inlineprotected

Member Function Documentation

◆ className()

virtual const String& G3D::XR::className ( ) const
pure virtual

Which subclass of XR is this?

Implemented in G3D::EmulatedXR, G3D::OpenVR, and G3D::MonitorXR.

◆ cleanup()

virtual void G3D::XR::cleanup ( )
inlinevirtual

Reimplemented in G3D::EmulatedXR, G3D::OpenVR, and G3D::MonitorXR.

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ hmdArray()

const Array<shared_ptr<HMD> >& G3D::XR::hmdArray ( ) const
inline

◆ nextEvent()

virtual shared_ptr<Event> G3D::XR::nextEvent ( )
inlinevirtual

Returns nullptr when out of events.

◆ objectArray()

const Array<shared_ptr<Object> >& G3D::XR::objectArray ( ) const
inline

All tracked objects, including HMDs.

◆ postGraphicsInit()

virtual void G3D::XR::postGraphicsInit ( const Settings settings)
inlinevirtual

Reimplemented in G3D::EmulatedXR, G3D::OpenVR, and G3D::MonitorXR.

◆ preGraphicsInit()

virtual void G3D::XR::preGraphicsInit ( const Settings settings)
inlinevirtual

Reimplemented in G3D::EmulatedXR, G3D::OpenVR, and G3D::MonitorXR.

◆ setFrame()

static void G3D::XR::setFrame ( const shared_ptr< Object > &  t,
const CFrame f,
const CFrame p 
)
static

Allows XR subclasses to access protected variables inside a tracked object.

◆ trackedVolume()

const TrackedVolume& G3D::XR::trackedVolume ( ) const
inline

◆ updateTrackingData()

virtual void G3D::XR::updateTrackingData ( )
pure virtual

Call once per frame.

Implemented in G3D::EmulatedXR, G3D::OpenVR, and G3D::MonitorXR.

Member Data Documentation

◆ m_eventQueue

Queue<shared_ptr<XR::Event> > G3D::XR::m_eventQueue
protected

Referenced by nextEvent().

◆ m_hmdArray

Array<shared_ptr<HMD> > G3D::XR::m_hmdArray
protected

Referenced by hmdArray().

◆ m_objectArray

Array<shared_ptr<Object> > G3D::XR::m_objectArray
protected

Referenced by objectArray().

◆ m_trackedVolume

TrackedVolume G3D::XR::m_trackedVolume
protected

Referenced by trackedVolume().


documentation generated on Wed Nov 24 2021 08:02:02 using doxygen 1.8.15