Pyrogenesis  trunk
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CTouchInput Class Reference

Maps touch events (e.g. More...

#include <TouchInput.h>

Collaboration diagram for CTouchInput:
Collaboration graph
[legend]

Public Member Functions

 CTouchInput ()
 
 ~CTouchInput ()
 
bool IsEnabled ()
 Returns whether the touch input mode is enabled for this device. More...
 
InReaction HandleEvent (const SDL_Event_ *ev)
 
void Frame ()
 Should be called once per frame to perform updates. More...
 

Private Types

enum  { MOUSE_INACTIVE, MOUSE_ACTIVATING, MOUSE_ACTIVE_UP, MOUSE_ACTIVE_DOWN }
 
enum  { STATE_INACTIVE, STATE_FIRST_TOUCH, STATE_PANNING, STATE_ZOOMING }
 

Private Member Functions

void OnFingerDown (int id, int x, int y)
 
void OnFingerUp (int id, int x, int y)
 
void OnFingerMotion (int id, int x, int y)
 

Private Attributes

int m_MouseEmulateState [MAX_MOUSE]
 
CVector2D m_MouseEmulateDownPos [MAX_MOUSE]
 
bool m_Down [MAX_FINGERS]
 
CVector2D m_Pos [MAX_FINGERS]
 
CVector2D m_Prev [MAX_FINGERS]
 
int m_State
 
double m_FirstTouchTime
 
CVector2D m_FirstTouchPos
 
CVector3D m_PanFocus
 
float m_PanDist
 

Static Private Attributes

static const size_t MAX_MOUSE = 2
 
static const size_t MAX_FINGERS = 2
 

Detailed Description

Maps touch events (e.g.

on Android touchscreen devices) onto mouse events and camera movement.

Member Enumeration Documentation

anonymous enum
private
Enumerator
MOUSE_INACTIVE 
MOUSE_ACTIVATING 
MOUSE_ACTIVE_UP 
MOUSE_ACTIVE_DOWN 
anonymous enum
private
Enumerator
STATE_INACTIVE 
STATE_FIRST_TOUCH 
STATE_PANNING 
STATE_ZOOMING 

Constructor & Destructor Documentation

CTouchInput::CTouchInput ( )
CTouchInput::~CTouchInput ( )

Member Function Documentation

void CTouchInput::Frame ( )

Should be called once per frame to perform updates.

InReaction CTouchInput::HandleEvent ( const SDL_Event_ ev)
bool CTouchInput::IsEnabled ( )

Returns whether the touch input mode is enabled for this device.

void CTouchInput::OnFingerDown ( int  id,
int  x,
int  y 
)
private
void CTouchInput::OnFingerMotion ( int  id,
int  x,
int  y 
)
private
void CTouchInput::OnFingerUp ( int  id,
int  x,
int  y 
)
private

Member Data Documentation

bool CTouchInput::m_Down[MAX_FINGERS]
private
CVector2D CTouchInput::m_FirstTouchPos
private
double CTouchInput::m_FirstTouchTime
private
CVector2D CTouchInput::m_MouseEmulateDownPos[MAX_MOUSE]
private
int CTouchInput::m_MouseEmulateState[MAX_MOUSE]
private
float CTouchInput::m_PanDist
private
CVector3D CTouchInput::m_PanFocus
private
CVector2D CTouchInput::m_Pos[MAX_FINGERS]
private
CVector2D CTouchInput::m_Prev[MAX_FINGERS]
private
int CTouchInput::m_State
private
const size_t CTouchInput::MAX_FINGERS = 2
staticprivate
const size_t CTouchInput::MAX_MOUSE = 2
staticprivate

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