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:
authorMike Erwin <significant.bit@gmail.com>2011-08-07 03:13:36 +0400
committerMike Erwin <significant.bit@gmail.com>2011-08-07 03:13:36 +0400
commit6c821f4078414c81128ebf0d35187054df238371 (patch)
tree4da39ec2542cfb97d4b8e5bdddcdf53a91e59d30
parent5dd2b3e06f0164bf4313a172240ad7f4d37bacbe (diff)
stricter NDOF guards for Windows (forgot in earlier commit)
-rw-r--r--build_files/scons/config/darwin-config.py1
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.h2
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c13
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c12
5 files changed, 24 insertions, 6 deletions
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py
index 560b6d9cb60..97e8e90e574 100644
--- a/build_files/scons/config/darwin-config.py
+++ b/build_files/scons/config/darwin-config.py
@@ -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':
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index c5dff27dace..858312b3eb1 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -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).
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index a555a196060..556f554eb98 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -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
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index b3dbafeab7d..57044188dd9 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -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");
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 0dac0bd7401..258d6bbc025 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -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;