CCal3dSceneNode.h

00001 
00002 #ifndef CCAL3DSCENENODE_H_INCLUDED
00003 #define CCAL3DSCENENODE_H_INCLUDED
00004 
00005 #include <irrlicht.h>
00006 
00007 #include <cal3d/cal3d.h>
00008 
00009 typedef irr::core::vector3df Vector3;
00010 
00011 class CCal3DSceneNode : public irr::scene::ISceneNode
00012 {
00013 protected:
00015         std::string configFile;
00016 
00018         std::string mediaPath;
00019 
00022         CalCoreModel* m_calCoreModel;
00023 
00025         CalModel* m_calModel;
00026 
00028         bool m_bPaused;
00029 
00031         float m_scale;
00032 
00034         int m_currentAnimationId;
00035 
00037         float m_leftAnimationTime;
00038 
00040         float m_blendTime;
00041 
00043         float m_lodLevel;
00044 
00046         irr::core::aabbox3df Box;
00047 
00049         irr::video::SMaterial material;
00050 
00052         irr::u32 lastTick;
00053 
00055         bool bInitialized;
00056 
00057 public :
00058 
00064         CCal3DSceneNode(const char* cf,
00065                 irr::scene::ISceneNode* parent, 
00066                 irr::scene::ISceneManager* mgr, irr::s32 id=-1);
00067 
00069         virtual ~CCal3DSceneNode();
00070 
00072 // irrlicht rendering stuff
00074 
00075         void OnPreRender();
00076 
00077         void render();
00078 
00079         void OnPostRender(irr::u32 timeMs);
00080 
00081         const irr::core::aabbox3df& getBoundingBox() const;
00082 
00083         irr::video::SMaterial& getMaterial(irr::s32 i)
00084         {
00085                 return material;
00086         }
00087 
00088         irr::s32 getMaterialCount()
00089         {
00090                 return 1;
00091         }
00092 
00094 // call 3d stuff
00096 
00100         bool parseModelConfiguration(const std::string &cf);
00101 
00102         // load all textures
00103         bool init();
00104 
00106 // dragon stuff
00108 
00109         void moveBone(int boneID, CalQuaternion& direction);
00110 
00111         CalQuaternion getBoneRotation(int boneID);
00112         CalQuaternion getCoreBoneRotation(int boneID);
00113 
00114         void setBoneRotation(int boneID, CalQuaternion& newRotation);
00115 
00116         void dumpBoneQaternion(int boneID);
00117         void quaternionToAxisAndAngle(CalQuaternion qIn, CalVector& vOut, float& aOut);
00118         void quaternionToAxisAndAngle(CalQuaternion qIn, CalQuaternion& qOut);
00119         float quaternionGetMagnitude(CalQuaternion qIn);
00120         void quaternionNormalize(CalQuaternion& qInOut);
00121 };
00122 
00123 #endif

Generated on Sun Dec 2 18:30:26 2007 for DrgonWings by  doxygen 1.5.4