diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-02 11:08:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-02 11:08:22 +0400 |
commit | 70b4758ff8756a55a1c88156a852b80a0d3c2ef9 (patch) | |
tree | 7fae0201d91cae49b5ade454f41ea17624038456 /source/blender/windowmanager | |
parent | 2e860a3e85d1f1045d15b525e3a88d3e8fbb6adf (diff) |
Made wmNDOFMotionData use a vector rather then xyz members, makes it nicer to use with math functions.
ndof_to_angle_axis and ndof_to_quat now use math functions.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 7476410ec19..7fd52e89a5f 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -389,8 +389,8 @@ typedef struct wmNDOFMotionData { /* awfully similar to GHOST_TEventNDOFMotionData... */ // 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: + float tvec[3]; // translation + float rvec[3]; // 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 diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 322cd3b5642..0abae2e06b7 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2323,13 +2323,13 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g const float s = U.ndof_sensitivity; - data->tx = s * ghost->tx; - data->ty = s * ghost->ty; - data->tz = s * ghost->tz; + data->tvec[0]= s * ghost->tx; + data->tvec[1]= s * ghost->ty; + data->tvec[2]= s * ghost->tz; - data->rx = s * ghost->rx; - data->ry = s * ghost->ry; - data->rz = s * ghost->rz; + data->rvec[0]= s * ghost->rx; + data->rvec[1]= s * ghost->ry; + data->rvec[2]= s * ghost->rz; data->dt = ghost->dt; |