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

WorldRotAxisInt.H

Go to the documentation of this file.
00001 
00011 #ifndef WORLDROTAXISINT_H
00012 #define WORLDROTAXISINT_H
00013 
00014 // gluebase includes
00015 #define OUTSIDE_GLUE_CORE
00016 #include <fsa/fsa.H>
00017 #include <dev/dev6d.H>
00018 #include <dev/room6d.H>
00019 #include <dev/buttons.H>
00020 #include <config/config.H>
00021 #include <mlib/points.H>
00022 
00023 // DrawObj includes
00024 #include "DrawObj.H"
00025 #include "glwrap.H"
00026 
00027 namespace InSpace {
00028 
00029 class WorldRotAxisDrawObj : public DrawObj
00030 {
00031  public:
00032 
00033   WorldRotAxisDrawObj() : DrawObj("WorldRotAxis_drawobj") {
00034     _afMatAmbient[0] = _afMatAmbient[1] = _afMatAmbient[2] = 0.2f;
00035     _afMatAmbient[3] = 1.0f;
00036     _afMatDiffuse[0] = 1.0f;
00037     _afMatDiffuse[2] = _afMatDiffuse[3] = 0.0f;
00038     _afMatSpecular[0] = _afMatSpecular[1] = _afMatSpecular[2] = _afMatSpecular[3] = 1.0f;
00039     _afMatShininess[0] = 50.0f;
00040   }
00041   virtual ~WorldRotAxisDrawObj() {}
00042 
00043   void contextInit();
00044   void draw();
00045 
00046   void setEndPoints(const Wpt& pos0, const Wpt& pos1) {
00047     _pos0 = pos0;
00048     _pos1 = pos1;
00049   }
00050 
00051  protected:
00052   
00053   // display list for the sphere
00054   isGlContextData<GLuint> _nSphere;
00055   Wpt _pos0, _pos1;
00056 
00057   float _afMatAmbient[4];
00058   float _afMatDiffuse[4];
00059   float _afMatSpecular[4];
00060   float _afMatShininess[1];  
00061 };
00062 
00063 class WorldRotAxisInt : public Interactor<WorldRotAxisInt>
00064 {
00065  public:
00066   
00067   WorldRotAxisInt();
00068   virtual ~WorldRotAxisInt();
00069 
00070   void setRotationAngle(float fAngle) { _fAngle = fAngle; }
00071 
00072  protected:
00073 
00074   WorldRotAxisDrawObj* _pWRADrawObj;
00075 
00076   void axis_on(cEVENTbtnptr &evt, STATE *&);
00077   void axis_off(cEVENTbtnptr &evt, STATE *&);
00078   void axis_motion(cEVENTroom6dptr &evt, STATE *&);
00079 
00080   EVENTroom6dptr _axis6dof;
00081   EVENTbtnptr    _axisbtnon;
00082   EVENTbtnptr    _axisbtnoff;  
00083   
00084   STATE _definingAxis;
00085 
00086   float _fAngle;
00087   int _firstMotion;
00088   int _rotation;
00089   Wpt _pos0, _pos1;
00090 };
00091 
00092 }
00093 #endif // WORLDROTAXISINT_H

Generated on Thu Jul 8 15:19:29 2004 for inspace by doxygen 1.3.4