home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / MacWT 0.9 / wt Source / object.h < prev    next >
Encoding:
Text File  |  1995-10-10  |  1.9 KB  |  64 lines  |  [TEXT/CWIE]

  1. /*
  2. **  MacWT -- a 3d game engine for the Macintosh
  3. **  © 1995, Bill Hayden and Nikol Software
  4. **  Free for non-commercial use - address questions to the e-mail address below
  5. **
  6. **  Mail:           afn28988@freenet.ufl.edu (Bill Hayden)
  7. **    MacWT FTP site: ftp.circa.ufl.edu/pub/software/ufmug/mirrors/LocalSW/Hayden/
  8. **  WWW Page:       http://grove.ufl.edu:80/~nikolsw
  9. **
  10. **    All of the above addresses are due to changes sometime in 1996, so stay tuned
  11. **
  12. **  based on wt, by Chris Laurel
  13. **
  14. **  This program is distributed in the hope that it will be useful,
  15. **  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. */
  18.  
  19.  
  20.  
  21. // (8 sides x 4 frames)
  22. #define MAX_IMAGES 32
  23.  
  24.  
  25. typedef struct {
  26.     double    mass;
  27.     double    xsize, ysize, height;
  28.     double    x, y, z;
  29.     double    dx, dy, dz;
  30.     double    angle;
  31.     double    angular_v;
  32.     double    drag;
  33.     short    num_images;
  34.     short    cur_image;
  35.     long    frameticks;        // Ticks until frame is advanced (zero means as fast as possible)
  36.     long    triggerticks;    // Next frame advance time in 1/60 seconds (ticks)
  37.     long    reference;        // To keep track of who's who or other pertinant data
  38.     World    *world;
  39.     Region    *region;
  40.     Texture    *image[MAX_IMAGES];
  41. } Object;
  42.  
  43. typedef struct {
  44.     double left;
  45.     double top;
  46.     double right;
  47.     double bottom;
  48. } Bounds;
  49.  
  50. extern Object *new_object(double mass, double xsize, double ysize, double height, double drag);
  51. extern void object_update(Object *o);
  52. extern void object_apply_force(Object *o, double fx, double fy, double fz);
  53. extern void object_apply_torque(Object *o, double torque);
  54. extern void object_set_position(Object *o, double x, double y, double z);
  55.  
  56. extern void add_object(World *w, Object *o);
  57. extern Boolean remove_object(World *w, Object *o);
  58.  
  59. extern void object_view(Object *o, View *v);
  60.  
  61. void AdvanceFrame(Object *o);
  62. Boolean AddFrame(Object *o, char *TextureName);
  63. #define SetFrame(o,num) (o)->cur_image=num
  64.