Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of ~archive/QuickAnimation


Ignore:
Timestamp:
Nov 28, 2007, 2:05:49 AM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/QuickAnimation

    v1 v1  
     1= !QuickAnimation =
     2[[ArchivePage]]
     3
     4file: 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
     8The 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
     10Acctually 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}}}
     29outputs:
     30{{{
     31QuickAnimation:: key at position 0.600000 already added. Use changeValue instead
     32QuickAnim(KeyFrames:3, Resolution:100)::(position, value) (0.000000, 1.000000)->(0.500000, 10.000000)->(0.600000, 4.000000)->
     330.000000  -  1.000000
     340.100000  -  2.800000
     350.200000  -  4.600000
     360.300000  -  6.400000
     370.400000  -  8.200000
     380.500000  -  10.000000
     390.600000  -  4.000003
     400.700000  -  4.000000
     410.800000  -  4.000000
     420.900000  -  4.000000
     43}}}