Blender V5.0
GHOST_NDOFManager Class Referenceabstract

#include <GHOST_NDOFManager.hh>

Inherited by GHOST_NDOFManagerCocoa, GHOST_NDOFManagerUnix, and GHOST_NDOFManagerWin32.

Public Member Functions

virtual ~GHOST_NDOFManager ()=default
virtual bool available ()=0
NDOF Manager Class
 GHOST_NDOFManager (GHOST_System &)
NDOF Device Setup
bool setDevice (unsigned short vendor_id, unsigned short product_id)
NDOF Motion
void setDeadZone (float)
bool sendMotionEvent ()
NDOF Update State
void updateTranslation (const int t[3], uint64_t time)
void updateRotation (const int r[3], uint64_t time)

Protected Attributes

GHOST_Systemsystem_

NDOF Buttons

void updateButtonRAW (int button_number, bool press, uint64_t time)
void updateButton (GHOST_NDOF_ButtonT button, bool press, uint64_t time)
void updateButtonsBitmask (int button_bits, uint64_t time)
void updateButtonsArray (NDOF_Button_Array buttons, uint64_t time, NDOF_Button_Type type)

Detailed Description

Definition at line 46 of file GHOST_NDOFManager.hh.

Constructor & Destructor Documentation

◆ GHOST_NDOFManager()

◆ ~GHOST_NDOFManager()

virtual GHOST_NDOFManager::~GHOST_NDOFManager ( )
virtualdefault

Member Function Documentation

◆ available()

virtual bool GHOST_NDOFManager::available ( )
pure virtual

Whether multi-axis functionality is available (via the OS or driver) does not imply that a device is plugged in or being used.

Implemented in GHOST_NDOFManagerCocoa, GHOST_NDOFManagerUnix, and GHOST_NDOFManagerWin32.

◆ sendMotionEvent()

bool GHOST_NDOFManager::sendMotionEvent ( )

Processes and sends most recent raw data as an #NDOFMotion event returns whether an event was sent.

Definition at line 664 of file GHOST_NDOFManager.cc.

References CLOG_DEBUG, data, GHOST_kFinished, GHOST_kFinishing, GHOST_kInProgress, GHOST_kNotStarted, GHOST_kStarting, LOG, ndof_progress_string, NDOF_TIME_DELTA_STARTING, nearHomePosition(), and system_.

◆ setDeadZone()

void GHOST_NDOFManager::setDeadZone ( float dz)

Filter out small/accidental/un-calibrated motions by setting up a "dead zone" around home position set to 0 to disable 0.1 is a safe and reasonable value.

Definition at line 637 of file GHOST_NDOFManager.cc.

References CLOG_INFO, and LOG.

◆ setDevice()

◆ updateButton()

◆ updateButtonRAW()

void GHOST_NDOFManager::updateButtonRAW ( int button_number,
bool press,
uint64_t time )

The latest raw button data from the device use HID button encoding (not #NDOF_ButtonT).

Definition at line 535 of file GHOST_NDOFManager.cc.

References CLOG_DEBUG, LOG, and updateButton().

Referenced by GHOST_NDOFManagerUnix::processEvents().

◆ updateButtonsArray()

void GHOST_NDOFManager::updateButtonsArray ( NDOF_Button_Array buttons,
uint64_t time,
NDOF_Button_Type type )

Definition at line 592 of file GHOST_NDOFManager.cc.

References LongButton, and updateButton().

◆ updateButtonsBitmask()

void GHOST_NDOFManager::updateButtonsBitmask ( int button_bits,
uint64_t time )

Definition at line 557 of file GHOST_NDOFManager.cc.

References diff(), mask(), and updateButton().

◆ updateRotation()

void GHOST_NDOFManager::updateRotation ( const int r[3],
uint64_t time )

Definition at line 381 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManagerUnix::processEvents().

◆ updateTranslation()

void GHOST_NDOFManager::updateTranslation ( const int t[3],
uint64_t time )

The latest raw axis data from the device.

Note
axis data should be in blender view coordinates
  • +X is to the right.
  • +Y is up.
  • +Z is out of the screen.
  • for rotations, look from origin to each +axis.
  • rotations are + when CCW, - when CW. Each platform is responsible for getting axis data into this form these values should not be scaled (just shuffled or flipped).

Definition at line 374 of file GHOST_NDOFManager.cc.

Referenced by GHOST_NDOFManagerUnix::processEvents().

Member Data Documentation

◆ system_

GHOST_System& GHOST_NDOFManager::system_
protected

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