| | 1 | = !QuickAnimation = |
| | 2 | [[ArchivePage]] |
| | 3 | |
| | 4 | file: source:/trunk/src/lib/particles/quick_animation.h |
| | 5 | == whats this == |
| | 6 | !QuickAnimation is a wrapped lookup-table, that returns Values from Positions between 0.0 and 1.0 |
| | 7 | |
| | 8 | The Joke is, that one can add Key-Frames (with any values, and position between 0.0 and 1.0) and then retrieve a Value between those !KeyFrames. |
| | 9 | |
| | 10 | Acctually it is like a curve from 0.0 to 1.0. |
| | 11 | |
| | 12 | |
| | 13 | == usage == |
| | 14 | {{{ |
| | 15 | #!cpp |
| | 16 | QuickAnimation test; |
| | 17 | |
| | 18 | test.addKey(.5, 10.0); |
| | 19 | test.addKey(.6, 3); |
| | 20 | test.addKey(.6, 3); |
| | 21 | test.changeValue(.6, 4); |
| | 22 | test.addKey(.0, 1); |
| | 23 | |
| | 24 | test.debug(); |
| | 25 | |
| | 26 | for (float f = 0.0; f < 1.0; f+= .1) |
| | 27 | printf("%f - %f\n", f, test.getValue(f)); |
| | 28 | }}} |
| | 29 | outputs: |
| | 30 | {{{ |
| | 31 | QuickAnimation:: key at position 0.600000 already added. Use changeValue instead |
| | 32 | QuickAnim(KeyFrames:3, Resolution:100)::(position, value) (0.000000, 1.000000)->(0.500000, 10.000000)->(0.600000, 4.000000)-> |
| | 33 | 0.000000 - 1.000000 |
| | 34 | 0.100000 - 2.800000 |
| | 35 | 0.200000 - 4.600000 |
| | 36 | 0.300000 - 6.400000 |
| | 37 | 0.400000 - 8.200000 |
| | 38 | 0.500000 - 10.000000 |
| | 39 | 0.600000 - 4.000003 |
| | 40 | 0.700000 - 4.000000 |
| | 41 | 0.800000 - 4.000000 |
| | 42 | 0.900000 - 4.000000 |
| | 43 | }}} |