SoControllerButtonEvent Class Reference
[Events]

VSG extension Controller button press and release event. More...

#include <Inventor/events/SoControllerButtonEvent.h>

Inheritance diagram for SoControllerButtonEvent:
SoButtonEvent SoEvent SoTypedObject

List of all members.

Public Types

enum  Button {
  ANY = 0,
  BUTTON1 = 1,
  BUTTON2 = 2,
  BUTTON3 = 3
}

Public Member Functions

virtual SoType getTypeId () const
 SoControllerButtonEvent ()
void setButton (SoControllerButtonEvent::Button b)
SoControllerButtonEvent::Button getButton () const
void setPosition3 (const SbVec3f &p)
const SbVec3fgetPosition3 () const
void setOrientation (float x, float y, float z)
void setOrientation (SbRotation orientation)
void setOrientation (const SbVec3f &axis, float angle)
const SbRotationgetOrientation () const
const SbLine getRay () const
virtual const SbTrackerInfogetTrackerInfo () const
virtual const SbTrackerInfotrackerInfo () const

Static Public Member Functions

static SoType getClassTypeId ()
static SbBool isButtonPressEvent (const SoEvent *e, SoControllerButtonEvent::Button whichButton)
static SbBool isButtonReleaseEvent (const SoEvent *e, SoControllerButtonEvent::Button whichButton)

Detailed Description

VSG extension Controller button press and release event.

SoControllerButtonEvent represents controller button press and release events in the Open Inventor event model. A controller device generally has associated 3D tracker information.

A "tracker" is any device whose position and orientation are dynamically tracked in 3D, typically for immersive VR applications. For example: a head tracker. A "controller" is an input device which typically has buttons and/or valuators (e.g. a joystick). Many controllers have an associated tracker. For example, the commonly used "wand" input device has three buttons, a two-axis joystick (two valuators), and an associated tracker.

The virtual method SoEvent::getTrackerInfo() can be used to determine if an event object has associated tracker information. Traditional 2D events like SoMouseButtonEvent and SoLocation2Event return NULL. 3D events like SoTrackerEvent and SoControllerButtonEvent return a their associated tracker information (SbTrackerInfo).

Many controller devices generate a continuous stream of data, so strictly speaking there are no "events". However Open Inventor classes that recognize the SoControllerButtonEvent interpret it as notification of a change in the button state (press or release). The application (or other software above Open Inventor) is responsible for deciding when to actually create an SoControllerButtonEvent.

Some convenience macros for determining if an event matches

SEE ALSO

SbTrackerInfo, SoEvent, SoTrackerEvent


Member Enumeration Documentation

Button.

Enumerator:
ANY 
BUTTON1 

Controller button 1.

BUTTON2 

Controller button 2.

BUTTON3 

Controller button 3.


Constructor & Destructor Documentation

SoControllerButtonEvent::SoControllerButtonEvent (  ) 

Constructor.


Member Function Documentation

SoControllerButtonEvent::Button SoControllerButtonEvent::getButton (  )  const [inline]

Get which button generated the event.

static SoType SoControllerButtonEvent::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoButtonEvent.

const SbRotation& SoControllerButtonEvent::getOrientation (  )  const [inline]

Get orientation of associated tracker as a standard Open Inventor rotation (quaternion).

const SbVec3f& SoControllerButtonEvent::getPosition3 (  )  const [inline]

Get position of associated tracker in world coordinates.

const SbLine SoControllerButtonEvent::getRay (  )  const [inline]

Get a ray for picking/intersecting.

This is a convenience function.

virtual const SbTrackerInfo* SoControllerButtonEvent::getTrackerInfo (  )  const [inline, virtual]

Returns the SbTrackerInfo object.

Can be used as a quick check if an SoEvent has tracker info associated with it.

Reimplemented from SoEvent.

virtual SoType SoControllerButtonEvent::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoButtonEvent.

static SbBool SoControllerButtonEvent::isButtonPressEvent ( const SoEvent e,
SoControllerButtonEvent::Button  whichButton 
) [static]

Convenience function to see if an SoEvent is a press of the passed mouse button.

static SbBool SoControllerButtonEvent::isButtonReleaseEvent ( const SoEvent e,
SoControllerButtonEvent::Button  whichButton 
) [static]

Convenience function to see if an SoEvent is a release of the passed mouse button.

void SoControllerButtonEvent::setButton ( SoControllerButtonEvent::Button  b  )  [inline]

Set which button generated the event.

void SoControllerButtonEvent::setOrientation ( const SbVec3f axis,
float  angle 
) [inline]

Set orientation value of associated tracker from axis and angle in radians.

void SoControllerButtonEvent::setOrientation ( SbRotation  orientation  )  [inline]

Set orientation value of associated tracker from an SbRotation.

void SoControllerButtonEvent::setOrientation ( float  x,
float  y,
float  z 
) [inline]

Set orientation value of associated tracker from Euler angles in radians (using the trackd convention Z*X*Y).

void SoControllerButtonEvent::setPosition3 ( const SbVec3f p  )  [inline]

Set position of associated tracker in world coordinates.

virtual const SbTrackerInfo& SoControllerButtonEvent::trackerInfo (  )  const [inline, virtual]

Get the SbTrackerInfo object.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/