Bowls
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
KinectInput Class Reference

Kinect Input Manager. More...

#include <Kinect.h>

Collaboration diagram for KinectInput:
Collaboration graph

Public Member Functions

 KinectInput (bool, TrackingPoint)
 Creates the Kinect Input Manager. More...
 
 ~KinectInput ()
 
void switchHand (TrackingPoint)
 Switch which hand the Kinect tracks. More...
 
bool startTracking ()
 Start tracking skeletons. More...
 
void update ()
 Update the Kinect Input Managers Internals. More...
 
cgg::Vec3 getHandPos ()
 Get the current tracked hand position. More...
 

Private Member Functions

bool initSensor ()
 Initializes the Kinect Sensor. More...
 
void processSkeletonData ()
 Processes a Skeleton. More...
 
void calculateHandPos (NUI_SKELETON_DATA)
 Calculates the selected hands position. More...
 
void kinectPosConversion ()
 Converts the hand position to usable numbers. More...
 

Private Attributes

INuiSensor * kinectSensor
 Pointer to a Kinect Sensor. More...
 
HANDLE nextSkeletonUpdate
 Handle that indicates when a skeleton is ready to process. More...
 
bool sitMode
 Whether the Kinect should look for standing or sitting skeletons. More...
 
NUI_SKELETON_POSITION_INDEX selectedJoint
 Which joint we want the Kinect to track. More...
 
cgg::Vec3 handPos
 Current position of the selected joint. More...
 

Detailed Description

Kinect Input Manager.

Manages all of the Kinect's initialization, updating and output.

Definition at line 18 of file Kinect.h.

Constructor & Destructor Documentation

KinectInput::KinectInput ( bool  ,
TrackingPoint   
)

Creates the Kinect Input Manager.

Parameters
bool- Enable sitMode for the Kinect
TrackingPoint- Which joint to track
KinectInput::~KinectInput ( )

Member Function Documentation

void KinectInput::calculateHandPos ( NUI_SKELETON_DATA  )
private

Calculates the selected hands position.

Parameters
NUI_SKELETON_DATA- The skeleton data
cgg::Vec3 KinectInput::getHandPos ( )

Get the current tracked hand position.

Gives positions in meters. X: -2.2 to 2.2, Y: -1.6 to 1.6, Z: 0.0 to 4.0 (These are Approximate)

Returns
cgg::Vec3 - The hand position
bool KinectInput::initSensor ( )
private

Initializes the Kinect Sensor.

Returns
bool - Was Kinect initialized
void KinectInput::kinectPosConversion ( )
private

Converts the hand position to usable numbers.

void KinectInput::processSkeletonData ( )
private

Processes a Skeleton.

Fetches the Skeleton and passes it through to calculateHandPos

bool KinectInput::startTracking ( )

Start tracking skeletons.

Must be run to get any skeleton data processed

Returns
bool - Was tracking started successfully
void KinectInput::switchHand ( TrackingPoint  )

Switch which hand the Kinect tracks.

Parameters
TrackingPoint- Which joint to track
void KinectInput::update ( )

Update the Kinect Input Managers Internals.

Checks if there is a skeleton available, if so it calls all the necessary functions to process the skeleton

Member Data Documentation

cgg::Vec3 KinectInput::handPos
private

Current position of the selected joint.

Definition at line 31 of file Kinect.h.

INuiSensor* KinectInput::kinectSensor
private

Pointer to a Kinect Sensor.

Definition at line 23 of file Kinect.h.

HANDLE KinectInput::nextSkeletonUpdate
private

Handle that indicates when a skeleton is ready to process.

Definition at line 25 of file Kinect.h.

NUI_SKELETON_POSITION_INDEX KinectInput::selectedJoint
private

Which joint we want the Kinect to track.

Definition at line 29 of file Kinect.h.

bool KinectInput::sitMode
private

Whether the Kinect should look for standing or sitting skeletons.

Definition at line 27 of file Kinect.h.


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