NDOF: rename 'zoom updown' to 'pan xy swap axis'

This swapped translation for all ndof events.
This commit is contained in:
2014-02-15 09:38:33 +11:00
parent 30e89552e2
commit eedba54aae
4 changed files with 18 additions and 31 deletions

View File

@@ -970,13 +970,13 @@ class USERPREF_MT_ndof_settings(Menu):
layout.prop(input_prefs, "ndof_panx_invert_axis") layout.prop(input_prefs, "ndof_panx_invert_axis")
layout.prop(input_prefs, "ndof_pany_invert_axis") layout.prop(input_prefs, "ndof_pany_invert_axis")
layout.prop(input_prefs, "ndof_panz_invert_axis") layout.prop(input_prefs, "ndof_panz_invert_axis")
layout.prop(input_prefs, "ndof_pan_yz_swap_axis")
layout.label(text="Zoom options") layout.label(text="Zoom options")
layout.prop(input_prefs, "ndof_zoom_invert") layout.prop(input_prefs, "ndof_zoom_invert")
layout.prop(input_prefs, "ndof_zoom_updown")
layout.separator() layout.separator()
layout.label(text="Fly options") layout.label(text="Fly/Walk options")
layout.prop(input_prefs, "ndof_fly_helicopter", icon='NDOF_FLY') layout.prop(input_prefs, "ndof_fly_helicopter", icon='NDOF_FLY')
layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM') layout.prop(input_prefs, "ndof_lock_horizon", icon='NDOF_DOM')

View File

@@ -793,7 +793,7 @@ typedef enum eNdof_Flag {
/* actually... users probably don't care about what the mode /* actually... users probably don't care about what the mode
* is called, just that it feels right */ * is called, just that it feels right */
/* zoom is up/down if this flag is set (otherwise forward/backward) */ /* zoom is up/down if this flag is set (otherwise forward/backward) */
NDOF_ZOOM_UPDOWN = (1 << 7), NDOF_PAN_YZ_SWAP_AXIS = (1 << 7),
NDOF_ZOOM_INVERT = (1 << 8), NDOF_ZOOM_INVERT = (1 << 8),
NDOF_ROTATE_INVERT_AXIS = (1 << 9), NDOF_ROTATE_INVERT_AXIS = (1 << 9),
NDOF_TILT_INVERT_AXIS = (1 << 10), NDOF_TILT_INVERT_AXIS = (1 << 10),

View File

@@ -4046,10 +4046,10 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_range(prop, 0.25f, 40.0f); RNA_def_property_range(prop, 0.25f, 40.0f);
RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting"); RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Overall sensitivity of the 3D Mouse for orbiting");
prop = RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "ndof_pan_yz_swap_axis", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN); RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_PAN_YZ_SWAP_AXIS);
RNA_def_property_ui_text(prop, "Zoom = Up/Down", RNA_def_property_ui_text(prop, "Y/Z Swap Axis",
"Zoom using up/down on the device (otherwise forward/backward)"); "Pan using up/down on the device (otherwise forward/backward)");
prop = RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT); RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);

View File

@@ -2855,33 +2855,20 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
{ {
wmNDOFMotionData *data = MEM_mallocN(sizeof(wmNDOFMotionData), "customdata NDOF"); 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; 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; * \note
data->rz = rs * ghost->rz; * - optionally swap Y/Z.
* - maintain handed-ness? or just do what feels right? not for now.
if (U.ndof_flag & NDOF_ZOOM_UPDOWN) { * - after testing seems best not to apply this to rotation.
/* rotate so Y is where Z was */ */
data->ty = s * ghost->tz; if (U.ndof_flag & NDOF_PAN_YZ_SWAP_AXIS) {
data->tz = s * ghost->ty; SWAP(float, data->tvec[1], data->tvec[2]);
/* 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;
} }
data->dt = ghost->dt; data->dt = ghost->dt;