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:
authorCampbell Barton <ideasman42@gmail.com>2014-02-15 02:38:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-15 02:54:11 +0400
commiteedba54aaec5251990761f2de8b56ed37ee0efcc (patch)
tree2b04a0c8ae3d009f9e01e1091e487e13d283dd84 /source/blender/windowmanager/intern
parent30e89552e2c3981865e537f6752c0aafe0920016 (diff)
NDOF: rename 'zoom updown' to 'pan xy swap axis'
This swapped translation for all ndof events.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index e311144f522..47fdb37d403 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2855,33 +2855,20 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
{
wmNDOFMotionData *data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF");
- const float s = U.ndof_sensitivity;
+ const float ts = U.ndof_sensitivity;
const float rs = U.ndof_orbit_sensitivity;
- data->tx = s * ghost->tx;
+ mul_v3_v3fl(data->tvec, &ghost->tx, ts);
+ mul_v3_v3fl(data->rvec, &ghost->rx, rs);
- data->rx = rs * ghost->rx;
- data->ry = rs * ghost->ry;
- data->rz = rs * ghost->rz;
-
- if (U.ndof_flag & NDOF_ZOOM_UPDOWN) {
- /* rotate so Y is where Z was */
- data->ty = s * ghost->tz;
- data->tz = s * ghost->ty;
- /* maintain handed-ness? or just do what feels right? */
-
- /* should this affect rotation also?
- * initial guess is 'yes', but get user feedback immediately!
- */
-#if 0
- /* after turning this on, my guess becomes 'no' */
- data->ry = s * ghost->rz;
- data->rz = s * ghost->ry;
-#endif
- }
- else {
- data->ty = s * ghost->ty;
- data->tz = s * ghost->tz;
+ /**
+ * \note
+ * - optionally swap Y/Z.
+ * - maintain handed-ness? or just do what feels right? not for now.
+ * - after testing seems best not to apply this to rotation.
+ */
+ if (U.ndof_flag & NDOF_PAN_YZ_SWAP_AXIS) {
+ SWAP(float, data->tvec[1], data->tvec[2]);
}
data->dt = ghost->dt;