载入中...
搜索中...
未找到
Touch.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Module.h"
5
6#include <vector>
7#include <limits>
8
9namespace eve::touch
10{
11
16public:
19 struct TouchInfo
20 {
21 int64_t id; // Identifier. Only unique for the duration of the touch-press.
22 double x; // Position in pixels along the x-axis.
23 double y; // Position in pixels along the y-axis.
24 double dx; // Amount in pixels moved along the x-axis.
25 double dy; // Amount in pixels moved along the y-axis.
26 double pressure;
27 };
28
30 virtual ~Touch() {}
31
35 virtual const std::vector<TouchInfo> &getTouches() const = 0;
36
40 virtual const TouchInfo &getTouch(int64_t id) const = 0;
41
43 int getTouchCount() const { return int(getTouches().size()); }
45 double getTouchX(int index) const;
47 double getTouchY(int index) const;
48
49}; // Touch
50
51} // eve::touch
#define EVENGINE_API_BACKENDS
Definition Export.h:108
float size
Definition TreeMesh.cpp:156
uint32_t index
EVENGINE_API_FOUNDATION public API.
Definition Module.h:46
Active touch-point query interface (positions in window pixels).
Definition Touch.h:15
virtual ~Touch()
Releases touch tracking state.
Definition Touch.h:30
virtual const std::vector< TouchInfo > & getTouches() const =0
Gets all currently active touches.
virtual const TouchInfo & getTouch(int64_t id) const =0
Gets a specific touch, using its ID.
int getTouchCount() const
Number of currently active touches.
Definition Touch.h:43
One active contact; id is unique only for the duration of the press.
Definition Touch.h:20