Holodisk model from the Fallout and Fallout 2 games.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
787 B

  1. // animation
  2. function get_anim_keys() = [
  3. 0, // initial
  4. 0.1, // resting
  5. 0.25, // holodisk free-inserted
  6. 0.3, // holodisk click-inserted
  7. 0.4, // laser raised, waiting
  8. 0.5, // start playing
  9. 0.7, // stop playing, start lowering laser
  10. 0.75, // laser lowered, holodisk removing
  11. 0.8, // holodisk click-removed
  12. 0.95, // holodisk free-removed, NOPing
  13. 1 // final
  14. ];
  15. function ANIM_START()=0;
  16. function ANIM_RESTING()=0;
  17. function ANIM_INSERTING()=1;
  18. function ANIM_OPENING()=2;
  19. function ANIM_RAISING()=3;
  20. function ANIM_WAITING()=4;
  21. function ANIM_PLAYING()=5;
  22. function ANIM_LOWERING()=6;
  23. function ANIM_CLOSING()=7;
  24. function ANIM_REMOVING()=8;
  25. function ANIM_END()=9;
  26. function anim(key_from, key_to, KEYS=get_anim_keys())
  27. = max(0, min(($t - KEYS[key_from]) / (KEYS[key_to] - KEYS[key_from]), 1));