stricter NDOF guards for Windows (forgot in earlier commit)

This commit is contained in:
Mike Erwin 2011-08-06 23:13:36 +00:00
parent 5dd2b3e06f
commit 6c821f4078
5 changed files with 24 additions and 6 deletions

@ -21,6 +21,7 @@ cmd = 'uname -p'
MAC_PROC=commands.getoutput(cmd)
cmd = 'uname -r'
cmd_res=commands.getoutput(cmd)
MAC_CUR_VER='10.5' # by default (test below fails on my 10.5 PowerPC)
if cmd_res[:2]=='7':
MAC_CUR_VER='10.3'
elif cmd_res[:2]=='8':

@ -302,6 +302,7 @@ protected:
*/
static void processMinMaxInfo(MINMAXINFO * minmax);
#ifdef WITH_INPUT_NDOF
/**
* Handles Motion and Button events from a SpaceNavigator or related device.
* Instead of returning an event object, this function communicates directly
@ -310,6 +311,7 @@ protected:
* @return Whether an event was generated and sent.
*/
bool processNDOF(RAWINPUT const& raw);
#endif
/**
* Returns the local state of the modifier keys (from the message queue).

@ -603,7 +603,7 @@ extern UserDef U; /* from blenkernel blender.c */
#define NDOF_ORBIT_INVERT_AXES (1 << 6)
/* zoom is up/down if this flag is set (otherwise forward/backward) */
#define NDOF_ZOOM_UPDOWN (1 << 7)
#define NDOF_INVERT_ZOOM (1 << 8)
#define NDOF_ZOOM_INVERT (1 << 8)
#ifdef __cplusplus

@ -2746,19 +2746,32 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
/* 3D mouse settings */
/* global options */
prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.25f, 4.0f);
RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
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_ui_text(prop, "Invert Zoom", "Zoom using opposite direction");
/* 3D view */
prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
/* TODO: update description when fly-mode visuals are in place ("projected position in fly mode")*/
/* 3D view: orbit */
prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
/* in 3Dx docs, this is called 'object mode' vs. 'target camera mode'
/* 3D view: fly */
prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");

@ -2330,26 +2330,28 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
const float s = U.ndof_sensitivity;
data->tvec[0]= s * ghost->tx;
data->rvec[0]= s * ghost->rx;
data->rvec[1]= s * ghost->ry;
data->rvec[2]= s * ghost->rz;
if (U.ndof_flag & NDOF_ZOOM_UPDOWN)
{
// swap Y and Z
// rotate so Y is where Z was (maintain handed-ness)
data->tvec[1]= s * ghost->tz;
data->tvec[2]= s * ghost->ty;
data->tvec[2]= s * -ghost->ty;
// 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;
#endif
}
else
{
data->tvec[1]= s * ghost->ty;
data->tvec[2]= s * ghost->tz;
data->rvec[1]= s * ghost->ry;
data->rvec[2]= s * ghost->rz;
}
data->dt = ghost->dt;