gee_move_around_path.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 /* COPYRIGHT
00004  *
00005  * This file is part of the Visual Effects Engine - VEE
00006  *
00007  * Read the "VEE-LICENSE" file for the license.
00008  *
00009  * Authors & Copyright:   
00010  *
00011  * Tommi Ilmonen, Tuukka Heikura, Marko Myllymaa and 
00012  * Janne Kontkanen 2001-2004
00013  *
00014  * Additional copyrights: Tekes 2003-2004
00015  *
00016  * firstname.lastname@hut.fi
00017  *
00018  */
00019 
00020 #ifndef GEE_MOVE_AROUND_PATH_H
00021 #define GEE_MOVE_AROUND_PATH_H
00022 
00023 #include <gee_mover.h>
00024 #include <gee_path_to_x.h>
00025 
00026 #include <vector>
00027 
00028 class GEE_MoveAroundPath : public GEE_PathToX, public GEE_Mover
00029 {
00030 public:
00031 
00032   enum Algorithm {
00033     ALGO_OLD_BUGGY,
00034     ALGO_NEW1
00035   };
00036 
00037   GEE_MoveAroundPath(GEE_id_t pathId = -1, 
00038          GEE_id_t geoId = -1, 
00039          bool rotate = false,
00040          bool useNapra = false,
00041          float radiusNorm = 1.0f,
00042          float exaggerateRadius = 0.0f);
00043   virtual ~GEE_MoveAroundPath();
00044   
00045   virtual id_container * getExtraIds();
00046 
00047   virtual bool act(GEE_World *, const GEE_TimeStamp &);
00048 
00049   virtual bool read(GEE_Io *);
00050   virtual bool write(GEE_Io *);
00051   virtual const char * type();
00052   static GEE_Operator * create();
00053 
00054   virtual void getBoundingBox(VEE_BoundingBox *);
00056   virtual bool move(VEE_Vector3 *);
00057   virtual void moved(GEE_Geometry *);
00058 
00059   void setParams(float radius, float pressure)
00060   { m_radius = radius; m_pressure = pressure; }
00061 
00062   void setRadius(float radius) { m_radius = radius; }
00063 
00064   void addGeometryId(GEE_id_t geoId) { m_geoIds.insert(geoId); }
00065 
00066 protected:
00067 
00068   virtual bool handleNewVertex(GEE_Path3D::iterator &);
00069 
00070   virtual void doMove(GEE_World *);
00071 
00072   class Move
00073   {
00074   public:
00075     Move() : m_radius(1.0f) {}
00076 
00077     VEE_Vector3 m_origin;
00078     VEE_Vector3 m_move;
00079     VEE_Matrix3d m_rotate;
00080     float        m_radius;
00081   };
00082 
00083   VEE_Vector3          m_curLoc;
00084   VEE_Matrix3d         m_curRot;
00085 
00086   std::vector<Move>    m_moves;
00087   VEE_BoundingBox      m_bbox;
00088 
00089   float                m_radius;
00090   float                m_exaggerateRadius;
00091   float                m_radiusNorm;
00092   float                m_pressure;
00093   int                  m_algorithm;
00094 
00097   id_container m_geoIds;
00098   bool     m_rotate;
00099   bool     m_useNapra;
00100 };
00101 
00102 
00103 #endif

Generated on Mon Mar 12 21:09:00 2007 for VEE - The Visual Effects Engine by  doxygen 1.4.6