1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/* -----------------------------------------------------------------
GEM - Graphics Environment for Multimedia
Load an asset (like .obj oder .dxf)
Copyright (c) 2001-2012 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
-----------------------------------------------------------------*/
#ifndef _INCLUDE__GEMPLUGIN__MODELASSIMP2_MODELASSIMP2_H_
#define _INCLUDE__GEMPLUGIN__MODELASSIMP2_MODELASSIMP2_H_
#include "plugins/modelloader.h"
#include <assimp.h>
#include <aiPostProcess.h>
#include <aiScene.h>
#include "Gem/GemGL.h"
/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
modelASSIMP2
loads an Alias WaveFront .obj file as an asset
KEYWORDS
asset model
-----------------------------------------------------------------*/
namespace gem
{
namespace plugins
{
class GEM_EXPORT modelASSIMP2 : public gem::plugins::modelloader
{
public:
/////////
// ctor/dtor
modelASSIMP2(void);
virtual ~modelASSIMP2(void);
virtual bool isThreadable(void)
{
return true;
}
//////////
// open/close an asset
virtual bool open(const std::string&, const gem::Properties&);
virtual void close(void);
//////////
// render the asset
virtual bool render(void);
virtual bool compile(void);
//////////
// property handling
virtual bool enumProperties(gem::Properties&, gem::Properties&);
virtual void setProperties(gem::Properties&);
virtual void getProperties(gem::Properties&);
std::vector<std::vector<float> > getVector(std::string vectorName);
std::vector<VBOarray> getVBOarray();
void unsetRefresh();
bool needRefresh();
void fillVBOarray();
protected:
virtual void destroy(void);
bool m_rebuild;
const aiScene *m_scene;
float m_scale;
struct aiVector3D m_offset;
struct aiVector3D m_min, m_max, m_center;
bool m_useMaterial;
std::vector<std::vector<float> > m_vertices, m_normals, m_texcoords,
m_colors;
std::vector<VBOarray> m_VBOarray;
bool m_refresh;
bool m_have_texcoords;
std::string m_textype;
};
};
}; // namespace gem::plugins
#endif // for header file
|