Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_types.h27
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c2
2 files changed, 19 insertions, 10 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 26c394a2ad3..7476410ec19 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -377,17 +377,24 @@ typedef struct wmTabletData {
float Ytilt; /* as above */
} wmTabletData;
-typedef struct {
+typedef enum { // motion progress, for modal handlers
+ P_NOT_STARTED,
+ P_STARTING, // <--
+ P_IN_PROGRESS, // <-- only these are sent for NDOF motion
+ P_FINISHING, // <--
+ P_FINISHED
+ } wmProgress;
+
+typedef struct wmNDOFMotionData {
/* awfully similar to GHOST_TEventNDOFMotionData... */
-
- /* Each component normally ranges from -1 to +1, but can exceed that. */
-
- float tx, ty, tz; /* translation: -x left, +y forward, -z up */
- float rx, ry, rz; /* rotation:
- axis = (rx,ry,rz).normalized
- amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg] */
-
- float dt; // time since previous NDOF Motion event (or zero if this is the first)
+ // Each component normally ranges from -1 to +1, but can exceed that.
+ // These use blender standard view coordinates, with positive rotations being CCW about the axis.
+ float tx, ty, tz; // translation
+ float rx, ry, rz; // rotation:
+ // axis = (rx,ry,rz).normalized
+ // amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
+ float dt; // time since previous NDOF Motion event
+ wmProgress progress; // is this the first event, the last, or one of many in between?
} wmNDOFMotionData;
typedef struct wmTimer {
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index b41eebc5298..c2df53c9e91 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2324,6 +2324,8 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
data->dt = ghost->dt;
+ data->progress = (wmProgress) ghost->progress;
+
event->custom = EVT_DATA_NDOF_MOTION;
event->customdata = data;
event->customdatafree = 1;