home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / directx / boids / boids.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-15  |  1.8 KB  |  72 lines

  1. #ifndef BOIDS_H
  2. #define BOIDS_H
  3. /*
  4. **-----------------------------------------------------------------------------
  5. **  File:       Boids.h
  6. **  Purpose:    Sample showing DrawPrimitive functionality 
  7. **
  8. **    Copyright (C) 1995 - 1997 Microsoft Corporation. All Rights Reserved.
  9. **-----------------------------------------------------------------------------
  10. */
  11.  
  12. /*
  13. **-----------------------------------------------------------------------------
  14. **    Include files
  15. **-----------------------------------------------------------------------------
  16. */
  17.  
  18. #include "Common.h"
  19.  
  20.  
  21. /*
  22. **-----------------------------------------------------------------------------
  23. **    Typedefs
  24. **-----------------------------------------------------------------------------
  25. */
  26.  
  27. typedef struct t_boid {
  28.     D3DVECTOR    loc;
  29.     D3DVECTOR    dir;        // cur direction
  30.     D3DVECTOR    delta_pos;    // change in position from flock centering
  31.     D3DVECTOR    delta_dir;    // change in direction
  32.     int            delta_cnt;    // number of boids that influence this delta_dir
  33.     float        speed;
  34.     float        yaw, pitch, roll, dyaw;
  35.     D3DVECTOR    color;
  36. } Boid;
  37.  
  38. typedef struct t_obstacle {
  39.     D3DVECTOR    loc;
  40.     float        radius;
  41. } Obstacle;
  42.  
  43. typedef struct t_flock {
  44.     int            num_boids;
  45.     Boid        *boids;
  46.     int            num_obs;
  47.     Obstacle    *obs;
  48.     float        **dist;    // 2-d array of boid distances, yuk what a waste
  49.     D3DVECTOR    goal;
  50. } Flock;
  51.  
  52.  
  53.  
  54. /*
  55. **-----------------------------------------------------------------------------
  56. **    Function Prototypes
  57. **-----------------------------------------------------------------------------
  58. */
  59.  
  60. // Boids Functions
  61. void UpdateFlock (Flock flock);
  62.  
  63.  
  64. /*
  65. **----------------------------------------------------------------------------
  66. ** End of File
  67. **----------------------------------------------------------------------------
  68. */
  69. #endif // BOIDS_H
  70.  
  71.  
  72.