- Timestamp:
- 01/05/09 16:48:21 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.h
r3012 r3247 5 5 #include <string> 6 6 #include <vector> 7 #include <map> 7 8 8 /*struct SimpleVec 9 10 struct Material 9 11 { 10 SimpleVec() {} 11 SimpleVec(float _x, float _y, float _z): x(_x), y(_y), z(_z) {} 12 float rgb[3]; 13 int texture; 14 }; 12 15 13 float x, y, z; 14 };*/ 16 class Geometry; 15 17 16 18 typedef std::vector<SimpleVec> VertexArray; 17 19 typedef std::pair<float, float> Texcoord; 20 typedef std::map<std::string, Material *> MaterialTable; 21 typedef std::map<std::string, int> TextureTable; 22 23 typedef std::vector<std::string> TextureArray; 18 24 19 25 class ogzstream; … … 29 35 bool Convert(const std::string &inputFilename, 30 36 const std::string &outputFilename); 31 // const std::string textureFilename) const; 37 // const std::string textureFilename) const; 38 39 bool LoadMaterials(const std::string &matFileName); 32 40 33 41 ~ObjConverter(); … … 40 48 SimpleVec *mNormals; 41 49 Texcoord *mTexcoords; 50 Material *mMaterial; 42 51 43 52 int mVertexCount; … … 45 54 }; 46 55 56 typedef std::vector<Geometry *> GeometryArray; 57 47 58 void LoadShape(const VertexArray &faceVertices, 48 59 const VertexArray &faceNormals, 49 const std::vector<Texcoord> &faceTexcoords); 60 const std::vector<Texcoord> &faceTexcoords, 61 Material *mat); 50 62 51 63 void WriteGeometry(ogzstream &str, Geometry *geom); … … 55 67 56 68 57 std::vector<Geometry *> mGeometry; 69 MaterialTable mMaterialTable; 70 TextureTable mTextureTable; 71 72 TextureArray mTextures; 73 GeometryArray mGeometry; 58 74 59 75 int mNumShapes;
Note: See TracChangeset
for help on using the changeset viewer.