diff options
author | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-04-09 18:45:42 +0200 |
---|---|---|
committer | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-04-09 18:45:42 +0200 |
commit | 6446339621792f4fb6b4b8e42c56c4a02f318497 (patch) | |
tree | d20e3e1ca4654910df6f7fbee0c2aeeb271b96a1 | |
parent | 52e42f94635ff133de06b05bdc56ae4206472efa (diff) | |
download | 3d-6446339621792f4fb6b4b8e42c56c4a02f318497.tar.gz 3d-6446339621792f4fb6b4b8e42c56c4a02f318497.tar.bz2 |
Use cube progress value instead of own animation calculation.
-rw-r--r-- | 3d.c | 17 | ||||
-rw-r--r-- | 3d.xml.in | 8 |
2 files changed, 6 insertions, 19 deletions
@@ -128,7 +128,6 @@ tdPreparePaintScreen (CompScreen *s, int msSinceLastPaint) { CompWindow *w; - float amount; Bool active; TD_SCREEN (s); @@ -137,11 +136,13 @@ tdPreparePaintScreen (CompScreen *s, active = (cs->rotationState != RotationNone) && s->hsize > 2 && !(tdGetManualOnly(s) && (cs->rotationState != RotationManual)); - amount = ((float)msSinceLastPaint * tdGetSpeed (s) / 1000.0); - if (active) + if (active || tds->basicScale != 1.0) { float maxDiv = (float) tdGetMaxWindowSpace (s) / 100; float minScale = (float) tdGetMinCubeSize (s) / 100; + float x, progress; + + (*cs->getRotation) (s, &x, &x, &progress); tds->maxDepth = 0; for (w = s->windows; w; w = w->next) @@ -159,17 +160,11 @@ tdPreparePaintScreen (CompScreen *s, } minScale = MAX (minScale, 1.0 - (tds->maxDepth * maxDiv)); - if (cs->invert == 1) - tds->basicScale = MAX (minScale, tds->basicScale - amount); - else - tds->basicScale = MIN (2 - minScale, tds->basicScale + amount); + tds->basicScale = 1.0 - ((1.0 - minScale) * progress); } else { - if (cs->invert == 1) - tds->basicScale = MIN (1.0, tds->basicScale + amount); - else - tds->basicScale = MAX (1.0, tds->basicScale - amount); + tds->basicScale = 1.0; } /* comparing float values with != is error prone, so better cache @@ -34,14 +34,6 @@ <min>0</min> <max>50</max> </option> - <option name="speed" type="float"> - <_short>Animation Speed</_short> - <_long>Change the speed of the 3D animation</_long> - <default>0.2</default> - <min>0.0</min> - <max>1.0</max> - <precision>0.01</precision> - </option> <option name="manual_only" type="bool"> <_short>3D Only On Mouse Rotate</_short> <_long>Initiates the 3D display only if rotate is mouse driven. (Ex. You rotate the cube via the mouse)</_long> |