Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
G3D::OpenVR::OpenVRController Class Reference

Inherits G3D::XR::Controller.

Classes

class  Button
 
class  Stick
 

Public Member Functions

virtual float angleDelta (JoystickIndex s) const override
 Value of the joystick axis a. More...
 
virtual bool currentlyDown (GKey k) const override
 State (true = pressed, false = released) of the button at the end of the frame. More...
 
virtual Vector2 delta (JoystickIndex s) const override
 
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...
 
virtual bool hasPhysicalJoystick () const
 
virtual bool hasTouchpad () const
 
const int index () const
 Zero-based index in the XR::objectArray. More...
 
virtual bool isController () const override
 
virtual bool isHMD () const
 
bool isLeft () const override
 Is currently in the left hand. More...
 
bool isRight () const override
 Is currently in the right hand. More...
 
virtual bool justPressed (GKey k) const override
 Was this button pressed at least once since the previous simulation frame? More...
 
virtual bool justReleased (GKey k) const override
 Was this button released at least once since the previous simulation frame? More...
 
String modelFilename () const override
 Name of an .ArticulatedModel.Any file to use as the 3D representation of this 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...
 
const CFramepreviousFrame () const
 Frame that was predicted at the previous HMD::submit() time. More...
 
virtual Vector2 stickPosition (JoystickIndex s) const override
 

Static Public Member Functions

static shared_ptr< Objectcreate (int index, int nativeAPIIndex, const String &name)
 
static shared_ptr< OpenVRControllercreate (int index, int openVRIndex, const String &name, bool isRight, bool hasTouchpad, const String &modelFilename)
 

Protected Member Functions

 OpenVRController (int index, int openVRIndex, const String &name, bool isRight, bool hasTouchpad, const String &modelFilename)
 
const Buttonbutton (GKey k) const
 Performs range checking. More...
 
const Stickstick (JoystickIndex s) const
 Performs range checking. More...
 
virtual void update (vr::IVRSystem *)
 

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

Button m_buttonArray [NUM_BUTTONS]
 
CFrame m_frame
 
bool m_hasTouchpad = false
 
int m_index
 
bool m_isRight = true
 False for the left... More...
 
String m_modelFilename
 
String m_name
 
int m_nativeAPIIndex
 
CFrame m_previousFrame
 
Stick m_stickArray [NUM_STICKS]
 
friend OpenVR
 

Static Protected Attributes

static const int NUM_BUTTONS = GKey::CONTROLLER_RIGHT_TRIGGER - GKey::CONTROLLER_A + 1
 
static const int NUM_STICKS = 6
 

Constructor & Destructor Documentation

◆ OpenVRController()

G3D::OpenVR::OpenVRController::OpenVRController ( int  index,
int  openVRIndex,
const String name,
bool  isRight,
bool  hasTouchpad,
const String modelFilename 
)
inlineprotected

Member Function Documentation

◆ angleDelta()

virtual float G3D::OpenVR::OpenVRController::angleDelta ( JoystickIndex  s) const
overridevirtual

Value of the joystick axis a.

Returns the counter-clockwise angle in radians that the stick has rotated through since the last HMD::submit

Implements G3D::XR::Controller.

◆ button()

const Button& G3D::OpenVR::OpenVRController::button ( GKey  k) const
protected

Performs range checking.

Referenced by currentlyDown(), justPressed(), and justReleased().

◆ 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<OpenVRController> G3D::OpenVR::OpenVRController::create ( int  index,
int  openVRIndex,
const String name,
bool  isRight,
bool  hasTouchpad,
const String modelFilename 
)
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>.

◆ currentlyDown()

virtual bool G3D::OpenVR::OpenVRController::currentlyDown ( GKey  b) const
inlineoverridevirtual

State (true = pressed, false = released) of the button at the end of the frame.

Implements G3D::XR::Controller.

◆ delta()

virtual Vector2 G3D::OpenVR::OpenVRController::delta ( JoystickIndex  s) const
inlineoverridevirtual

Implements G3D::XR::Controller.

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

◆ hasPhysicalJoystick()

virtual bool G3D::OpenVR::OpenVRController::hasPhysicalJoystick ( ) const
inlinevirtual
See also
hasTouchpad

Implements G3D::XR::Controller.

◆ hasTouchpad()

virtual bool G3D::OpenVR::OpenVRController::hasTouchpad ( ) const
inlinevirtual
See also
hasPhysicalJoystick

Implements G3D::XR::Controller.

Referenced by create().

◆ index()

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

◆ isController()

virtual bool G3D::XR::Controller::isController ( ) const
inlineoverridevirtualinherited

Reimplemented from G3D::XR::Object.

◆ isHMD()

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

Reimplemented in G3D::XR::HMD.

◆ isLeft()

bool G3D::OpenVR::OpenVRController::isLeft ( ) const
inlineoverridevirtual

Is currently in the left hand.

Implements G3D::XR::Controller.

◆ isRight()

bool G3D::OpenVR::OpenVRController::isRight ( ) const
inlineoverridevirtual

Is currently in the right hand.

Implements G3D::XR::Controller.

Referenced by create().

◆ justPressed()

virtual bool G3D::OpenVR::OpenVRController::justPressed ( GKey  b) const
inlineoverridevirtual

Was this button pressed at least once since the previous simulation frame?

Implements G3D::XR::Controller.

◆ justReleased()

virtual bool G3D::OpenVR::OpenVRController::justReleased ( GKey  b) const
inlineoverridevirtual

Was this button released at least once since the previous simulation frame?

Implements G3D::XR::Controller.

◆ modelFilename()

String G3D::OpenVR::OpenVRController::modelFilename ( ) const
overridevirtual

Name of an .ArticulatedModel.Any file to use as the 3D representation of this controller.

Implements G3D::XR::Controller.

Referenced by create().

◆ 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(), G3D::EmulatedXR::EmulatedHMD::create(), and G3D::XR::Hand::create().

◆ previousFrame()

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

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

◆ stick()

const Stick& G3D::OpenVR::OpenVRController::stick ( JoystickIndex  s) const
protected

Performs range checking.

Referenced by delta(), and stickPosition().

◆ stickPosition()

virtual Vector2 G3D::OpenVR::OpenVRController::stickPosition ( JoystickIndex  s) const
inlineoverridevirtual

Implements G3D::XR::Controller.

◆ update()

virtual void G3D::OpenVR::OpenVRController::update ( vr::IVRSystem *  )
protectedvirtual

Member Data Documentation

◆ m_buttonArray

Button G3D::OpenVR::OpenVRController::m_buttonArray[NUM_BUTTONS]
protected

◆ m_frame

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

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

◆ m_hasTouchpad

bool G3D::OpenVR::OpenVRController::m_hasTouchpad = false
protected

Referenced by hasPhysicalJoystick(), and hasTouchpad().

◆ m_index

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

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

◆ m_isRight

bool G3D::OpenVR::OpenVRController::m_isRight = true
protected

False for the left...

Referenced by isLeft(), and isRight().

◆ m_modelFilename

String G3D::OpenVR::OpenVRController::m_modelFilename
protected

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

Stick G3D::OpenVR::OpenVRController::m_stickArray[NUM_STICKS]
protected

◆ NUM_BUTTONS

const int G3D::OpenVR::OpenVRController::NUM_BUTTONS = GKey::CONTROLLER_RIGHT_TRIGGER - GKey::CONTROLLER_A + 1
staticprotected

◆ NUM_STICKS

const int G3D::OpenVR::OpenVRController::NUM_STICKS = 6
staticprotected

◆ OpenVR

friend G3D::OpenVR::OpenVRController::OpenVR
protected

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