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:
authorCampbell Barton <ideasman42@gmail.com>2007-04-21 15:23:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-04-21 15:23:45 +0400
commit60af30ec8a674f6fc45cf8b1f47ecabe32728275 (patch)
treea8ec42fa440bf1d5154f299b8423b23519aca275 /source/blender/src/editview.c
parent6f9e78641cfb76189359489a1fb33596807b5e7a (diff)
lightwave_import - tested with many more new files, fixed a rare error (probably bad file)
export_fbx - export lamps, (point/spot/sun), Mesh edges, Dupli'Objects and static particles as edges. bug fix in material export and better reuse of some standard text chunks. fly mode, added acceleration on mouse-wheel and +/- so flicking the mousewheel has more effect and dosnt feel so slugish. BPySys.py - cleanName, dumb mistake.
Diffstat (limited to 'source/blender/src/editview.c')
-rw-r--r--source/blender/src/editview.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index 3511e460a2d..aacb083e98a 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -2122,10 +2122,10 @@ void fly(void)
moffset[2], /* mouse offset from the views center */
tmp_quat[4], /* used for rotating the view */
winxf, winyf, /* scale the mouse movement by this value - scales mouse movement to the view size */
- time_redraw, time_redraw_clamped; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */
+ time_redraw, time_redraw_clamped, time_wheel; /*time how fast it takes for us to redraw, this is so simple scenes dont fly too fast */
-
- double time_current, time_lastdraw;
+ /* time_lastwheel is used to accelerate when using the mousewheel a lot */
+ double time_current, time_lastdraw, time_currwheel, time_lastwheel;
short val, /* used for toets to see if a buttons pressed */
cent_orig[2], /* view center */
@@ -2235,7 +2235,7 @@ void fly(void)
winyf= (float)(curarea->winy)-(ymargin*2);
- time_lastdraw= PIL_check_seconds_timer();
+ time_lastdraw= time_lastwheel= PIL_check_seconds_timer();
G.vd->flag2 |= V3D_FLYMODE; /* so we draw the corner margins */
scrarea_do_windraw(curarea);
@@ -2254,11 +2254,24 @@ void fly(void)
action= 1; /* Accepted */
break;
} else if(toets==PADPLUSKEY || toets==EQUALKEY || toets==WHEELUPMOUSE) {
+ time_currwheel= PIL_check_seconds_timer();
+ time_wheel = (float)(time_currwheel - time_lastwheel);
+ time_lastwheel = time_currwheel;
+ /*printf("Wheel %f\n", time_wheel);*/
+ /*Mouse wheel delays range from 0.5==slow to 0.01==fast*/
+ time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */
+
if (speed<0) speed=0;
- else speed+= G.vd->grid;
+ else speed+= G.vd->grid * time_wheel;
+
} else if(toets==PADMINUS || toets==MINUSKEY || toets==WHEELDOWNMOUSE) {
+ time_currwheel= PIL_check_seconds_timer();
+ time_wheel = (float)(time_currwheel - time_lastwheel);
+ time_lastwheel = time_currwheel;
+ time_wheel = 1+ (10 - (20*MIN2(time_wheel, 0.5))); /* 0-0.5 -> 0-5.0 */
+
if (speed>0) speed=0;
- else speed-= G.vd->grid;
+ else speed-= G.vd->grid*time_wheel;
} else if (toets==MIDDLEMOUSE) {
/* make it so the camera direction dosent follow the view