[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39159] trunk/blender/source/blender/ windowmanager: ndof data change: operators can access values as vectors or components, as both are handy
Mike Erwin
significant.bit at gmail.com
Sun Aug 7 20:03:43 CEST 2011
My bad! Fixed the typo, and the negation is intentional -- not sure if
it's more important to maintain handedness or just do what feels
natural.
Mike Erwin
musician, naturalist, pixel pusher, hacker extraordinaire
On Sun, Aug 7, 2011 at 12:56 PM, Campbell Barton <ideasman42 at gmail.com> wrote:
> data->tvec[2]= s * -ghost->ty; lost the '-' and data->rx = s *
> ghost->rx; are now all 'rx', best double check these commits esp hours
> before an rc.
>
> On Mon, Aug 8, 2011 at 3:22 AM, Mike Erwin <significant.bit at gmail.com> wrote:
>> Revision: 39159
>> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39159
>> Author: merwin
>> Date: 2011-08-07 17:22:47 +0000 (Sun, 07 Aug 2011)
>> Log Message:
>> -----------
>> ndof data change: operators can access values as vectors or components, as both are handy
>>
>> Modified Paths:
>> --------------
>> trunk/blender/source/blender/windowmanager/WM_types.h
>> trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
>>
>> Modified: trunk/blender/source/blender/windowmanager/WM_types.h
>> ===================================================================
>> --- trunk/blender/source/blender/windowmanager/WM_types.h 2011-08-07 17:19:18 UTC (rev 39158)
>> +++ trunk/blender/source/blender/windowmanager/WM_types.h 2011-08-07 17:22:47 UTC (rev 39159)
>> @@ -389,8 +389,14 @@
>> /* 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 tvec[3]; // translation
>> - float rvec[3]; // rotation:
>> + union {
>> + float tvec[3]; // translation
>> + struct { float tx, ty, tz; };
>> + };
>> + union {
>> + float rvec[3]; // rotation:
>> + struct { float rx, ry, rz; };
>> + };
>> // axis = (rx,ry,rz).normalized
>> // amount = (rx,ry,rz).magnitude [in revolutions, 1.0 = 360 deg]
>> float dt; // time since previous NDOF Motion event
>>
>> Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
>> ===================================================================
>> --- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-08-07 17:19:18 UTC (rev 39158)
>> +++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-08-07 17:22:47 UTC (rev 39159)
>> @@ -2329,29 +2329,32 @@
>>
>> const float s = U.ndof_sensitivity;
>>
>> - data->tvec[0]= s * ghost->tx;
>> + data->tx = s * ghost->tx;
>>
>> - data->rvec[0]= s * ghost->rx;
>> - data->rvec[1]= s * ghost->ry;
>> - data->rvec[2]= s * ghost->rz;
>> + data->rx = s * ghost->rx;
>> + data->rx = s * ghost->ry;
>> + data->rx = s * ghost->rz;
>>
>> if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
>> {
>> - // rotate so Y is where Z was (maintain handed-ness)
>> - data->tvec[1]= s * ghost->tz;
>> - data->tvec[2]= s * -ghost->ty;
>> + /* 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->rvec[1]= s * ghost->rz;
>> - data->rvec[2]= s * ghost->ry;
>> + /* 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->tvec[1]= s * ghost->ty;
>> - data->tvec[2]= s * ghost->tz;
>> + data->ty = s * ghost->ty;
>> + data->tz = s * ghost->tz;
>> }
>>
>> data->dt = ghost->dt;
>>
>> _______________________________________________
>> Bf-blender-cvs mailing list
>> Bf-blender-cvs at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>>
>
>
>
> --
> - Campbell
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
More information about the Bf-committers
mailing list