home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 02 Useful Techniques / 04 Orkin / main.cpp < prev   
Encoding:
C/C++ Source or Header  |  2001-06-27  |  1.3 KB  |  58 lines

  1. #include "AnimController.h"
  2.  
  3. void main()
  4. {
  5.     //
  6.     // ---- BEGIN STUB CODE -------
  7.     //
  8.  
  9.     // Anim files should really be read from external data files, 
  10.     // probably exported from 3D Studio Max or Maya.
  11.     // Hardcode a few for demo purposes.
  12.  
  13.     AnimFileStruct animIdle;
  14.     strcpy(animIdle.szFileName, "idle.anm");
  15.     animIdle.eCategory = kACat_FullBody;
  16.     animIdle.nPriority = 0;
  17.  
  18.     AnimFileStruct animWalk;
  19.     strcpy(animWalk.szFileName, "walk.anm");
  20.     animWalk.eCategory = kACat_FullBody;
  21.     animWalk.nPriority = 1;
  22.  
  23.     AnimFileStruct animFidget;
  24.     strcpy(animFidget.szFileName, "fidget.anm");
  25.     animFidget.eCategory = kACat_LeftArm;
  26.     animFidget.nPriority = 2;
  27.  
  28.     AnimFileStruct animAttack;
  29.     strcpy(animAttack.szFileName, "attack.anm");
  30.     animAttack.eCategory = kACat_UpperBody;
  31.     animAttack.nPriority = 5;
  32.  
  33.     //
  34.     // ---- END STUB CODE -------
  35.     //
  36.  
  37.     
  38.     // This demonstrates how the controller decides which
  39.     // animations should be playing at any instant.
  40.     // The Print() function displays the currently playing
  41.     // animations in the order they would be processing
  42.     // the skeleton.
  43.  
  44.     CAnimController animCtrl;
  45.  
  46.     animCtrl.PlayAnim(&animIdle);
  47.     animCtrl.Print();
  48.  
  49.     animCtrl.PlayAnim(&animWalk);
  50.     animCtrl.Print();
  51.  
  52.     animCtrl.PlayAnim(&animFidget);
  53.     animCtrl.Print();
  54.  
  55.     animCtrl.PlayAnim(&animAttack);
  56.     animCtrl.Print();
  57. }
  58.