11 #include "utils/Vector.h" 27 bool valid()
const {
return x >= 0.0f && y >= 0.0f && time >= 0; }
70 bool valid()
const {
return down.valid(); }
83 bool velocity(
float& velocityX,
float& velocityY,
bool fromLast =
true)
const 85 int64_t fromTime = last.time;
98 int64_t timeDiff = current.time - fromTime;
102 velocityX = ((current.x - fromX) * 1000000000) / timeDiff;
103 velocityY = ((current.y - fromY) * 1000000000) / timeDiff;
bool valid() const
Checks if the "down" touch is valid.
Definition: TouchTypes.h:70
void copy(const Touch &other)
Copies the x/y coordinates and the time from the given touch.
Definition: TouchTypes.h:34
void reset()
Resets the pointer and all its touches.
Definition: TouchTypes.h:57
A class representing a touch pointer interaction consisting of an down touch, the last touch and the ...
Definition: TouchTypes.h:49
bool valid() const
Checks if the touch is valid i.e. if the x/y coordinates and the time are >= 0.
Definition: TouchTypes.h:27
bool velocity(float &velocityX, float &velocityY, bool fromLast=true) const
Calculates the velocity in x/y direction using the "down" and either the "last" or "current" touch...
Definition: TouchTypes.h:83
A class representing a touch consisting of an x and y coordinate and a time.
Definition: TouchTypes.h:18