Blender  V3.3
Public Member Functions | Protected Attributes | List of all members
GHOST_NDOFManager Class Referenceabstract

#include <GHOST_NDOFManager.h>

Inheritance diagram for GHOST_NDOFManager:
GHOST_NDOFManagerCocoa GHOST_NDOFManagerUnix GHOST_NDOFManagerWin32

Public Member Functions

 GHOST_NDOFManager (GHOST_System &)
 
virtual ~GHOST_NDOFManager ()
 
virtual bool available ()=0
 
bool setDevice (unsigned short vendor_id, unsigned short product_id)
 
void setDeadZone (float)
 
void updateTranslation (const int t[3], uint64_t time)
 
void updateRotation (const int r[3], uint64_t time)
 
void updateButton (int button_number, bool press, uint64_t time)
 
void updateButtons (int button_bits, uint64_t time)
 
bool sendMotionEvent ()
 

Protected Attributes

GHOST_Systemm_system
 

Detailed Description

Definition at line 89 of file GHOST_NDOFManager.h.

Constructor & Destructor Documentation

◆ GHOST_NDOFManager()

GHOST_NDOFManager::GHOST_NDOFManager ( GHOST_System sys)

Definition at line 134 of file GHOST_NDOFManager.cpp.

◆ ~GHOST_NDOFManager()

virtual GHOST_NDOFManager::~GHOST_NDOFManager ( )
inlinevirtual

Definition at line 92 of file GHOST_NDOFManager.h.

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_NDOFManagerWin32, GHOST_NDOFManagerUnix, and GHOST_NDOFManagerCocoa.

◆ 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 412 of file GHOST_NDOFManager.cpp.

References data, GHOST_WindowManager::getActiveWindow(), GHOST_System::getWindowManager(), GHOST_kFinished, GHOST_kFinishing, GHOST_kInProgress, GHOST_kNotStarted, GHOST_kStarting, m_system, nearHomePosition(), NULL, and GHOST_System::pushEvent().

◆ 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 378 of file GHOST_NDOFManager.cpp.

References GHOST_PRINTF.

◆ setDevice()

bool GHOST_NDOFManager::setDevice ( unsigned short  vendor_id,
unsigned short  product_id 
)

◆ updateButton()

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

◆ updateButtons()

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

Definition at line 362 of file GHOST_NDOFManager.cpp.

References KDL::diff(), mask(), time, and updateButton().

Referenced by DeviceEvent().

◆ updateRotation()

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

Definition at line 277 of file GHOST_NDOFManager.cpp.

References r, and time.

Referenced by DeviceEvent(), and 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 270 of file GHOST_NDOFManager.cpp.

References t, and time.

Referenced by DeviceEvent(), and GHOST_NDOFManagerUnix::processEvents().

Member Data Documentation

◆ m_system

GHOST_System& GHOST_NDOFManager::m_system
protected

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