Ignore:
Timestamp:
01/05/09 16:48:21 (15 years ago)
Author:
mattausch
Message:

worked on obj loader
played around with ssao sampling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/Converter/ObjConverter.h

    r3012 r3247  
    55#include <string> 
    66#include <vector> 
     7#include <map> 
    78 
    8 /*struct SimpleVec 
     9 
     10struct Material 
    911{ 
    10         SimpleVec() {} 
    11         SimpleVec(float _x, float _y, float _z): x(_x), y(_y), z(_z) {} 
     12        float rgb[3]; 
     13        int texture; 
     14}; 
    1215 
    13         float x, y, z; 
    14 };*/ 
     16class Geometry; 
    1517 
    1618typedef std::vector<SimpleVec> VertexArray; 
    1719typedef std::pair<float, float> Texcoord; 
     20typedef std::map<std::string, Material *> MaterialTable; 
     21typedef std::map<std::string, int> TextureTable; 
     22 
     23typedef std::vector<std::string> TextureArray; 
    1824 
    1925class ogzstream; 
     
    2935        bool Convert(const std::string &inputFilename,  
    3036                         const std::string &outputFilename); 
    31         // const std::string textureFilename) const; 
     37                     // const std::string textureFilename) const; 
     38 
     39        bool LoadMaterials(const std::string &matFileName); 
    3240 
    3341        ~ObjConverter(); 
     
    4048                SimpleVec *mNormals; 
    4149                Texcoord *mTexcoords; 
     50                Material *mMaterial; 
    4251 
    4352                int mVertexCount; 
     
    4554        }; 
    4655 
     56typedef std::vector<Geometry *> GeometryArray; 
     57 
    4758        void LoadShape(const VertexArray &faceVertices, 
    4859                           const VertexArray &faceNormals, 
    49                                    const std::vector<Texcoord> &faceTexcoords); 
     60                                   const std::vector<Texcoord> &faceTexcoords,  
     61                                   Material *mat); 
    5062 
    5163        void WriteGeometry(ogzstream &str, Geometry *geom); 
     
    5567 
    5668 
    57         std::vector<Geometry *> mGeometry; 
     69        MaterialTable mMaterialTable; 
     70        TextureTable mTextureTable; 
     71         
     72        TextureArray mTextures; 
     73        GeometryArray mGeometry; 
    5874 
    5975        int mNumShapes; 
Note: See TracChangeset for help on using the changeset viewer.