Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
G3D::EmulatedXR::EmulatedHMD Class Reference

Inherits G3D::XR::HMD.

Public Member Functions

virtual float displayFrequency () const
 In Hz. More...
 
const CFrameframe () const
 Where the AR/VR system estimates the object will be at the time of the next HMD::submit() call, in the room coordinate frame. More...
 
const shared_ptr< GazeTracker > & gazeTracker () const
 If the HMD has no true gaze tracker, it will create an emulation one that always looks forward. More...
 
virtual void getPassThroughVideo (shared_ptr< Texture > &left, shared_ptr< Texture > &right) const
 The left and right may be the same Texture. More...
 
virtual void getResolution (Vector2uint32 *resPerView) const
 Ideal resolution for one eye before warping. More...
 
virtual void getViewCameraMatrices (float nearPlaneZ, float farPlaneZ, CFrame *viewToHead, Projection *viewProjection) const override
 
const int index () const
 Zero-based index in the XR::objectArray. More...
 
virtual bool isController () const
 
virtual bool isHMD () const
 
const shared_ptr< Controller > & leftController () const
 If there is no tracked left controller, one is created and fixed relative to the head. More...
 
const shared_ptr< Hand > & leftHand () const
 If there is no hand tracking, it is inferred from the controller. More...
 
const Stringname () const
 Unique identifier. More...
 
int nativeAPIIndex () const
 Index of this object in the underlying OS API (e.g., OVR, OpenVR, SteamVR) More...
 
virtual int numViews () const override
 
const CFramepreviousFrame () const
 Frame that was predicted at the previous HMD::submit() time. More...
 
const shared_ptr< Controller > & rightController () const
 If there is no tracked right controller, one is created and fixed relative to the head. More...
 
virtual bool rightEyeDominant () const override
 Is the user's right (true) or left (false) eye dominant? More...
 
const shared_ptr< Hand > & rightHand () const
 If there is no hand tracking, it is inferred from the controller. More...
 
virtual bool rightHanded () const override
 Does the user prefer to use the right (true) or left (false) hand? More...
 
virtual float standingHeadHeight () const override
 Top of the user's head in the real world when standing. More...
 
virtual void submitFrame (RenderDevice *rd, const shared_ptr< Framebuffer > *hmdDeviceFramebuffer) override
 

Static Public Member Functions

static shared_ptr< Objectcreate (int index, int nativeAPIIndex, const String &name)
 
static shared_ptr< EmulatedHMDcreate (int index, int nativeAPIIndex, const String &name, EmulatedXR *xr)
 

Public Attributes

bool allowGameControllerToDriveHead = true
 

Protected Member Functions

 EmulatedHMD (int index, int nativeAPIIndex, const String &name, EmulatedXR *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

CFrame m_frame
 
shared_ptr< GazeTrackerm_gazeTracker
 
int m_index
 
shared_ptr< Controllerm_leftController
 
shared_ptr< Handm_leftHand
 
String m_name
 
int m_nativeAPIIndex
 
CFrame m_previousFrame
 
shared_ptr< Controllerm_rightController
 
shared_ptr< Handm_rightHand
 
GLint m_texIDs [2] = { 0, 0 }
 
EmulatedXRm_xr
 

Constructor & Destructor Documentation

◆ EmulatedHMD()

G3D::EmulatedXR::EmulatedHMD::EmulatedHMD ( int  index,
int  nativeAPIIndex,
const String name,
EmulatedXR xr 
)
inlineprotected

Member Function Documentation

◆ create() [1/2]

static shared_ptr<Object> G3D::XR::Object::create ( int  index,
int  nativeAPIIndex,
const String name 
)
inlinestaticinherited

◆ create() [2/2]

static shared_ptr<EmulatedHMD> G3D::EmulatedXR::EmulatedHMD::create ( int  index,
int  nativeAPIIndex,
const String name,
EmulatedXR xr 
)
inlinestatic

◆ 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>.

◆ displayFrequency()

virtual float G3D::EmulatedXR::EmulatedHMD::displayFrequency ( ) const
virtual

In Hz.

Implements G3D::XR::HMD.

◆ frame()

const CFrame& G3D::XR::Object::frame ( ) const
inlineinherited

Where the AR/VR system estimates the object will be at the time of the next HMD::submit() call, in the room coordinate frame.

◆ gazeTracker()

const shared_ptr<GazeTracker>& G3D::XR::HMD::gazeTracker ( ) const
inlineinherited

If the HMD has no true gaze tracker, it will create an emulation one that always looks forward.

◆ getPassThroughVideo()

virtual void G3D::EmulatedXR::EmulatedHMD::getPassThroughVideo ( shared_ptr< Texture > &  left,
shared_ptr< Texture > &  right 
) const
inlinevirtual

The left and right may be the same Texture.

They may also be Texture::black() if there is no passthrough video.

Implements G3D::XR::HMD.

◆ getResolution()

virtual void G3D::EmulatedXR::EmulatedHMD::getResolution ( Vector2uint32 resPerView) const
virtual

Ideal resolution for one eye before warping.

Implements G3D::XR::HMD.

◆ getViewCameraMatrices()

virtual void G3D::EmulatedXR::EmulatedHMD::getViewCameraMatrices ( float  nearPlaneZ,
float  farPlaneZ,
CFrame viewToHead,
Projection viewProjection 
) const
overridevirtual
Parameters
viewToHeadMust have numViews() elements.
viewProjectionMust have numViews() elements.

These may change every frame in some displays, such as those with dynamic foveal insets or that adjust the eyebox based on gaze tracking.

Implements G3D::XR::HMD.

◆ index()

const int G3D::XR::Object::index ( ) const
inlineinherited

◆ isController()

virtual bool G3D::XR::Object::isController ( ) const
inlinevirtualinherited

Reimplemented in G3D::XR::Controller.

◆ isHMD()

virtual bool G3D::XR::HMD::isHMD ( ) const
inlinevirtualinherited

Reimplemented from G3D::XR::Object.

◆ leftController()

const shared_ptr<Controller>& G3D::XR::HMD::leftController ( ) const
inlineinherited

If there is no tracked left controller, one is created and fixed relative to the head.

It can be driven using an GameController.

◆ leftHand()

const shared_ptr<Hand>& G3D::XR::HMD::leftHand ( ) const
inlineinherited

If there is no hand tracking, it is inferred from the controller.

◆ name()

const String& G3D::XR::Object::name ( ) const
inlineinherited

◆ nativeAPIIndex()

int G3D::XR::Object::nativeAPIIndex ( ) const
inlineinherited

Index of this object in the underlying OS API (e.g., OVR, OpenVR, SteamVR)

Referenced by G3D::XR::Object::create(), create(), and G3D::XR::Hand::create().

◆ numViews()

virtual int G3D::EmulatedXR::EmulatedHMD::numViews ( ) const
overridevirtual

Implements G3D::XR::HMD.

◆ previousFrame()

const CFrame& G3D::XR::Object::previousFrame ( ) const
inlineinherited

Frame that was predicted at the previous HMD::submit() time.

◆ rightController()

const shared_ptr<Controller>& G3D::XR::HMD::rightController ( ) const
inlineinherited

If there is no tracked right controller, one is created and fixed relative to the head.

It can be driven using an GameController.

◆ rightEyeDominant()

virtual bool G3D::EmulatedXR::EmulatedHMD::rightEyeDominant ( ) const
inlineoverridevirtual

Is the user's right (true) or left (false) eye dominant?

Implements G3D::XR::HMD.

◆ rightHand()

const shared_ptr<Hand>& G3D::XR::HMD::rightHand ( ) const
inlineinherited

If there is no hand tracking, it is inferred from the controller.

◆ rightHanded()

virtual bool G3D::EmulatedXR::EmulatedHMD::rightHanded ( ) const
inlineoverridevirtual

Does the user prefer to use the right (true) or left (false) hand?

Implements G3D::XR::HMD.

◆ standingHeadHeight()

virtual float G3D::EmulatedXR::EmulatedHMD::standingHeadHeight ( ) const
inlineoverridevirtual

Top of the user's head in the real world when standing.

Implements G3D::XR::HMD.

◆ submitFrame()

virtual void G3D::EmulatedXR::EmulatedHMD::submitFrame ( RenderDevice rd,
const shared_ptr< Framebuffer > *  hmdDeviceFramebuffer 
)
overridevirtual

Implements G3D::XR::HMD.

Member Data Documentation

◆ allowGameControllerToDriveHead

bool G3D::XR::HMD::allowGameControllerToDriveHead = true
inherited

◆ m_frame

CFrame G3D::XR::Object::m_frame
protectedinherited

Referenced by G3D::XR::Object::frame().

◆ m_gazeTracker

shared_ptr<GazeTracker> G3D::XR::HMD::m_gazeTracker
protectedinherited

◆ m_index

int G3D::XR::Object::m_index
protectedinherited

Referenced by G3D::XR::Object::index().

◆ m_leftController

shared_ptr<Controller> G3D::XR::HMD::m_leftController
protectedinherited

◆ m_leftHand

shared_ptr<Hand> G3D::XR::HMD::m_leftHand
protectedinherited

Referenced by G3D::XR::HMD::leftHand().

◆ m_name

String G3D::XR::Object::m_name
protectedinherited

Referenced by G3D::XR::Object::name().

◆ m_nativeAPIIndex

int G3D::XR::Object::m_nativeAPIIndex
protectedinherited

◆ m_previousFrame

CFrame G3D::XR::Object::m_previousFrame
protectedinherited

◆ m_rightController

shared_ptr<Controller> G3D::XR::HMD::m_rightController
protectedinherited

◆ m_rightHand

shared_ptr<Hand> G3D::XR::HMD::m_rightHand
protectedinherited

Referenced by G3D::XR::HMD::rightHand().

◆ m_texIDs

GLint G3D::EmulatedXR::EmulatedHMD::m_texIDs[2] = { 0, 0 }
mutableprotected

◆ m_xr

EmulatedXR* G3D::EmulatedXR::EmulatedHMD::m_xr
protected

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