Main Page | Modules | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members

object.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * $Id: object.h,v 1.1 2003/07/16 11:42:15 schou Exp $
00003  * Author: Jakob Schou Jensen <schou@sourceforge.net>
00004  * Licence: GPL
00005  *
00006  * Description: Object (base class for vehicle, ufo, ...)
00007  *
00008  ****************************************************************************/
00009 
00010 #ifndef OBJECT
00011 #define OBJECT
00012 
00013 #include <adsomath.h>
00014 
00015 enum DrawHint { DRAW_NORMAL, DRAW_PROFILE, DRAW_PROFILE_SMOOTH, DRAW_DEBUG };
00016 
00017 // Rotation base
00018 struct RBase {
00019   v3f x,y,z;
00020 };
00021 
00026 class Object {
00027 protected:
00028   bool enabled;
00029   v3f pos; 
00030   RBase r; 
00031 
00032   double boundSphereRadius;
00033   // collision box
00034   // collision points
00035  public:
00036   v3f getPos(){ return pos; }
00037   RBase getR(){ return r; }
00038   v3f dir(){ return r.y; } 
00039   v3f dup(){ return r.z; } 
00040   void setDir(v3f v){ r.y = v; }
00041   void setDup(v3f v){ r.z = v; }
00042   
00043   bool isEnabled(){ return enabled; }
00044   virtual void enable(bool s){ enabled = s; }
00045 
00047   virtual void draw(DrawHint hint){};
00048   Object(){ enabled = true; }
00049   virtual ~Object(){};
00050 };
00051 
00052 #endif

Generated on Mon Jul 21 10:44:47 2003 for Rover by doxygen 1.3.2