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:
authorMartin Poirier <theeth@yahoo.com>2007-08-31 02:02:32 +0400
committerMartin Poirier <theeth@yahoo.com>2007-08-31 02:02:32 +0400
commit800c6db46fd3d45c1ef16f1ba5f2ce4ab0fd9307 (patch)
tree851ae596f87b455c3051a1189f9ebe07de1a912a /source/blender/src/view.c
parent7f6bb8d8ccd49b3f14f9799962bfa37d47beef68 (diff)
Some cleanup of the ndof functions:
Moving filterNDOFvalues and getndof to editscreen.c/BIF_mywindow.h (this might not be the best spot but it matches table/mouse functions) Adding missing function definition in include files and fix declaration mixup (void functions used as int, short pointer used as float pointer) New NDofInput model for transform (reusable externally in the future): Handles ndof events, accumulates values and enables remapping and rescaling values to fit any axis combinaison into a float[3] (this could be extended in the future, also, it doesn't support out of order axis right now). Compatible with "gears" (Ctrl key) New transform context for pure NDof input transform (entered when using Transform mode on the device). In this mode, transform "transactions" are automatically confirmed when the device returns to its rest position Rotation on Z triggers a rotation (axis is perpendicular to the screen as usual, constraints works as expected) Rotation on X/Y triggers trackball rotation Translation on X/Y/Z triggers translation (doesn't support constraints correctly). The device can also be used during a "normal" transform operation. In this case, there is no auto confirm but button 1 (right) can be used to confirm while button 2 is used to clear the NDof input (back to mouse input). NDof support was added to translation, rotation and trackball (as previously mentionned) but also to Tilt (same as rotation) and Push/Pull (move device along Z axis). This is a bit preliminary work, so everyone should feel free to comment and send suggestions. NOTE: this commit also merges revision 11523 from the trunk
Diffstat (limited to 'source/blender/src/view.c')
-rw-r--r--source/blender/src/view.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 75869c7c937..9c8f333e2f7 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -572,21 +572,6 @@ float ndof_axis_scale[6] = {
int dz_flag = 0;
float m_dist;
-void getndof(float *sbval);
-
-static void filterNDOFvalues(float *sbval)
-{
- int i=0;
- float max = 0.0;
-
- for (i =0; i<5;i++)
- if (fabs(sbval[i]) > max)
- max = fabs(sbval[i]);
- for (i =0; i<5;i++)
- if (fabs(sbval[i]) != max )
- sbval[i]=0.0;
-}
-
void viewmoveNDOFfly(int mode)
{
int i;
@@ -2229,22 +2214,3 @@ void smooth_view_to_camera(View3D *v3d)
v3d->persp=2;
}
}
-
-void ndof_transform(void)
-{
- float fval[7];
-
- getndof(fval);
-
- if (G.vd->ndoffilter)
- filterNDOFvalues(fval);
-
- fval[0] = fval[0] * (1.0f/1024.0f);
- fval[1] = -fval[1] * (1.0f/1024.0f); // axis inversion
- fval[2] = -fval[2] * (1.0f/1024.0f); // axis inversion
- fval[3] = fval[3] * (1.0f/8024.0f);
- fval[4] = fval[4] * (1.0f/8024.0f);
- fval[5] = fval[5] * (1.0f/8024.0f);
-
- ndof_do_transform(fval);
-}