CUGL 2.1
Cornell University Game Library
Public Member Functions | Public Attributes | List of all members
cugl::CoreGestureEvent Class Reference

#include <CUCoreGesture.h>

Public Member Functions

 CoreGestureEvent ()
 
 CoreGestureEvent (const Timestamp &start)
 
 CoreGestureEvent (const CoreGestureEvent &event)
 
void clear ()
 

Public Attributes

Timestamp start
 
Timestamp now
 
CoreGestureType type
 
Vec2 origPosition
 
Vec2 currPosition
 
float origSpread
 
float currSpread
 
float origAngle
 
float currAngle
 

Detailed Description

This simple class is a struct to hold a core gesture event.

A core gesture is a gesture with duration. Hence this event stores information about the start of the event, as well as the current status of the event.

A core gesture contains three bits of information: the position of the fingers (computed as the average), the distance spread between the fingers, and the current angle of the line between the two fingers. All three values are continually updated regardless of the gesture type.

The gesture type is initially CoreGestureType::NONE, but transitions to one of the other types when a threshold is passed. The threshold limits are defined in CoreGesture.

The value of pan and pinch events is typically measured in pixels, as it is assumed that the touch device is also the display (e.g. most mobile devices). However, in situtations where that is not the case (e.g. MacBook trackpad), the values will be measured assuming the touch device is a unit square. In that case all pan positions are (0,0) to (1,1), while all pinch spreads are 0 to sqrt(2).

Constructor & Destructor Documentation

◆ CoreGestureEvent() [1/3]

cugl::CoreGestureEvent::CoreGestureEvent ( )
inline

Constructs a new gesture event with the default values

◆ CoreGestureEvent() [2/3]

cugl::CoreGestureEvent::CoreGestureEvent ( const Timestamp start)
inline

Constructs a new gesture event with the given timestamps

Parameters
startThe initial timestamp

◆ CoreGestureEvent() [3/3]

cugl::CoreGestureEvent::CoreGestureEvent ( const CoreGestureEvent event)
inline

Constructs a new gesture event that is a copy of the given one

Parameters
eventThe event to copy

Member Function Documentation

◆ clear()

void cugl::CoreGestureEvent::clear ( )
inline

Clears the contents of this gesture event

Member Data Documentation

◆ currAngle

float cugl::CoreGestureEvent::currAngle

The current angle of the gesture

◆ currPosition

Vec2 cugl::CoreGestureEvent::currPosition

The current position of the gesture

◆ currSpread

float cugl::CoreGestureEvent::currSpread

The current finger separation of the gesture

◆ now

Timestamp cugl::CoreGestureEvent::now

The current time of the gesture

◆ origAngle

float cugl::CoreGestureEvent::origAngle

The initial angle of the gesture

◆ origPosition

Vec2 cugl::CoreGestureEvent::origPosition

The initial position of the gesture

◆ origSpread

float cugl::CoreGestureEvent::origSpread

The initial finger separation of the gesture

◆ start

Timestamp cugl::CoreGestureEvent::start

The starting time of the gesture

◆ type

CoreGestureType cugl::CoreGestureEvent::type

The gesture type


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