Blender V2.61 - r43446
|
00001 00004 /****************************************************************************** 00005 * 00006 * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method 00007 * Copyright 2003-2006 Nils Thuerey 00008 * 00009 * A model laoded from Wavefront .obj file 00010 * 00011 *****************************************************************************/ 00012 #ifndef NTL_GEOMODEL_H 00013 #define NTL_GEOMODEL_H 00014 00015 #include "ntl_geometryobject.h" 00016 00018 class ntlGeometryObjModel : public ntlGeometryObject 00019 { 00020 public: 00021 /* Init constructor */ 00022 ntlGeometryObjModel( void ); 00023 /* Init constructor */ 00024 //ntlGeometryObjModel( ntlVec3Gfx start, ntlVec3Gfx end ); 00025 /* Destructor */ 00026 virtual ~ntlGeometryObjModel( void ); 00027 00029 virtual int getTypeId() { return GEOCLASSTID_OBJMODEL; } 00030 00032 virtual void initialize(ntlRenderGlobals *glob); 00033 00035 virtual bool getMeshAnimated(); 00036 00037 /* create triangles from obj */ 00038 virtual void getTriangles(double t, vector<ntlTriangle> *triangles, 00039 vector<ntlVec3Gfx> *vertices, 00040 vector<ntlVec3Gfx> *normals, int objectId ); 00041 00043 int loadBobjModel(string filename); 00045 int initModel(int numVertices, float *vertices, int numTriangles, int *triangles, 00046 int channelSize, float *channelVertices); 00048 virtual void calcTriangleDivs(vector<ntlVec3Gfx> &verts, vector<ntlTriangle> &tris, gfxReal fsTri); 00049 00051 void getExtends(ntlVec3Gfx &start, ntlVec3Gfx &end); 00052 00053 private: 00054 00056 ntlVec3Gfx mvStart, mvEnd; 00057 00059 bool mLoaded; 00060 00062 string mFilename; 00063 00065 vector<int> mTriangles; 00066 vector<ntlVec3Gfx> mVertices; 00067 vector<ntlVec3Gfx> mNormals; 00068 00070 AnimChannel<ntlSetVec3f> mcAniVerts; 00071 AnimChannel<ntlSetVec3f> mcAniNorms; 00073 AnimChannel<double> mcAniTimes; 00075 double mAniTimeScale, mAniTimeOffset; 00076 00077 public: 00078 00079 /* Access methods */ 00081 inline ntlVec3Gfx getStart( void ){ return mvStart; } 00082 inline void setStart( const ntlVec3Gfx &set ){ mvStart = set; } 00084 inline ntlVec3Gfx getEnd( void ){ return mvEnd; } 00085 inline void setEnd( const ntlVec3Gfx &set ){ mvEnd = set; } 00086 00087 inline bool getLoaded( void ){ return mLoaded; } 00088 inline void setLoaded( bool set ){ mLoaded = set; } 00089 00091 inline void setFilename(string set) { mFilename = set; } 00092 }; 00093 00094 #endif 00095