Main Page   Class Hierarchy   Compound List   File List   Compound Members  

movable.hpp

00001 #ifndef movable_H
00002 #define movable_H
00003 
00004 #include <string>
00005 /*
00006 #include <Panel.h>
00007 #include <FrameWindow.h>
00008 #include <CheckBox.h>
00009 #include <ActionMessage.h>
00010 //#include "buttonListeners.h"
00011 */
00012 #include "misc.hpp"
00013 
00014 
00015 
00016 #define ROTATE_SLOWNESS 8
00017 #define MOVE_INC  0.2f
00018 
00019 using namespace std;
00020 
00022 
00029 class movable
00030 {
00031 public:
00032 
00033         movable();
00034         movable(string name);
00035         virtual ~movable();
00036 
00037         void init();
00038 
00039         movable& operator= (const movable& other);
00040 
00041         virtual void draw();
00042         virtual void update();
00043 
00044         void move(int pitch, int turn, int roll, float x, float y, float z);
00045 
00046         void setName(string name);
00047 
00048 
00050 
00051 
00052         float mass;
00054         matrix9f Ibody;
00056         matrix9f IbodyInv; 
00057 
00059         matrix16f location,             // Rotation + location
00060                           newLocation;
00061 
00063         vector3f P,newP, 
00065                          L,newL; 
00066 
00067         
00068         // derived
00069         matrix9f Iinv;
00071         vector3f velocity,
00073                          omega;         
00074 
00076         vector3f force,
00078                          torque;
00079 
00080 
00081         bool normalize;
00082 
00083         float step;
00084         
00085 
00086         string name;
00087 
00088         
00089         //bounding box
00090         virtual void getBoundingBox();
00091         void getAABB();
00092         void drawAABB();
00093         void drawBoundingBox();
00094 
00095         bool drawBB;
00096 
00097         // has this been completely tested for collisions?
00098         bool BBtested;
00099 
00100         bool BBcollided;
00101 
00102         vector3f centerBB;
00103         vector3f edgesBB;
00104         vector3f boundingBox[8];
00105         
00106         vector3f oldCenterAABB;
00107         vector3f centerAABB;
00108         vector3f edgesAABB;
00109         vector3f AABB[8];
00110         
00111         //MovableType movableType;
00112 
00113         /*
00114         friend bool operator< (const movable& other);
00115         friend bool operator== (const movable& other);
00116         */
00117 
00118         // is the object moved normally or is
00119         // it subject to the physics engine?
00120         bool physical;
00121 
00122 private:        
00123 /*
00125 // GLG stuff
00126 public:
00127         
00128         Panel *movablePanel;
00129         FrameWindow *movableFrame;
00130 
00131         CheckBox *bbBox;
00132 
00133         CheckBoxListener *bbBoxListener;
00134 
00135 */
00136 };
00137 
00138 #endif // movable_H

Generated on Sat May 10 10:09:36 2003 for volume-src-limited by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002