Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CTouchInput Class Reference

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

#include <TouchInput.h>

Collaboration diagram for CTouchInput:

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

anonymous enum
private
Enumerator
MOUSE_INACTIVE 
MOUSE_ACTIVATING 
MOUSE_ACTIVE_UP 
MOUSE_ACTIVE_DOWN 

◆ anonymous enum

anonymous enum
private
Enumerator
STATE_INACTIVE 
STATE_FIRST_TOUCH 
STATE_PANNING 
STATE_ZOOMING 

Constructor & Destructor Documentation

◆ CTouchInput()

CTouchInput::CTouchInput ( )

◆ ~CTouchInput()

CTouchInput::~CTouchInput ( )

Member Function Documentation

◆ Frame()

void CTouchInput::Frame ( )

Should be called once per frame to perform updates.

◆ HandleEvent()

InReaction CTouchInput::HandleEvent ( const SDL_Event_ ev)

◆ IsEnabled()

bool CTouchInput::IsEnabled ( )

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

◆ OnFingerDown()

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

◆ OnFingerMotion()

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

◆ OnFingerUp()

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

Member Data Documentation

◆ m_Down

bool CTouchInput::m_Down[MAX_FINGERS]
private

◆ m_FirstTouchPos

CVector2D CTouchInput::m_FirstTouchPos
private

◆ m_FirstTouchTime

double CTouchInput::m_FirstTouchTime
private

◆ m_MouseEmulateDownPos

CVector2D CTouchInput::m_MouseEmulateDownPos[MAX_MOUSE]
private

◆ m_MouseEmulateState

int CTouchInput::m_MouseEmulateState[MAX_MOUSE]
private

◆ m_PanDist

float CTouchInput::m_PanDist
private

◆ m_PanFocus

CVector3D CTouchInput::m_PanFocus
private

◆ m_Pos

CVector2D CTouchInput::m_Pos[MAX_FINGERS]
private

◆ m_Prev

CVector2D CTouchInput::m_Prev[MAX_FINGERS]
private

◆ m_State

int CTouchInput::m_State
private

◆ MAX_FINGERS

const size_t CTouchInput::MAX_FINGERS = 2
staticprivate

◆ MAX_MOUSE

const size_t CTouchInput::MAX_MOUSE = 2
staticprivate

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