HTouchManager

class HTouchManager

The HTouchManager class stores and manages touch input.

HTouchManager manages touch input usually coming from a multi-touch enabled device.

Methods

HTouchManager::HTouchManager()

Constructs an HTouchManager object.

HTouchManager::~HTouchManager()

Destructor for HTouchManager

HTouchInfo *HTouchManager::AddTouch(float x, float y, float timestamp, int taps, MVO_POINTER_SIZED_UINT ident)

This method creates a HTouchInfo object and adds this object to the currently list of touch objects

Parameters

x: The X coordinate of the touch event, in window space.

y: The Y coordinate of the touch event, in window space.

timestamp: The time when the touch has occured

taps: Number of “taps” (one or more consecutive touches interpreted as one touch)

ident: Unique identifier

Returns

A new or preexisting TouchInfo object constructed from the provided input
void HTouchManager::ClearTouchActivity()

Clears the activity flag on all touches. Depending on the platform touches might be marked as “active” if they are referenced as part of a touch event. As an example a touch sequnce might start and end with 3 simultaneous touches but might consist of only one or two touches in between.

void HTouchManager::ClearTouches()
bool HTouchManager::RemoveTouch(MVO_POINTER_SIZED_UINT ident)

This method removes a touch object from the current list of touches.

Parameters

ident: Unique identifier of touch

Returns

True if touch was found
int HTouchManager::GetActiveTouchCount()

Returns

Numher of active touches.
int HTouchManager::GetTouchCount()

Returns

Numher of total touches.
int HTouchManager::GetTouches(HTouchInfo *touches[], int maxtouches, bool activeOnly = false)

This method retrieves an array of touches

Parameters

touches: Array of pointers to HTouchInfo Objects. Returned to caller. Passed by reference always.

maxtouches: Maximum number of touches returned in “touches”

activeOnly: Only return active touches

Returns

Number of touches
HTouchInfo *HTouchManager::GetTouch(int index, bool activeOnly = false)

This method retrieves a single touch object

Parameters

index: Zero based index less than GetTouchCount() or GetActiveTouchCount()

activeOnly: Only return active touches

Returns

HTouchInfo or NULL

Variables

unsigned int HTouchManager::m_ActiveTouches

private

unsigned int
vlist_s *HTouchManager::m_TouchList

private

vlist_s