00001
00002
00003 #ifndef NVGLMODEL_H_
00004 #define NVGLMODEL_H_
00005
00006 #include <NvFoundation.h>
00007
00008
00009 #include "NV/NvPlatformGL.h"
00010 #include "NV/NvMath.h"
00011
00014
00015 class NvModel;
00016
00019 class NvGLModel
00020 {
00021 public:
00022 NvGLModel();
00023 ~NvGLModel();
00024
00029 void loadModelFromObjData(char *fileData);
00030
00036 void rescaleModel(float radius);
00037
00043 void initBuffers(bool computeTangents = false);
00044
00049 void drawElements(GLint positionHandle);
00050
00056 void drawElements(GLint positionHandle, GLint normalHandle);
00057
00064 void drawElements(GLint positionHandle, GLint normalHandle, GLint texcoordHandle);
00065
00073 void drawElements(GLint positionHandle, GLint normalHandle, GLint texcoordHandle, GLint tangentHandle);
00074
00078 NvModel *getModel();
00079
00081 void computeCenter();
00082
00083 nv::vec3f m_center;
00084
00085 private:
00086 NvModel *model;
00087 GLuint model_vboID, model_iboID;
00088 nv::vec3f m_minExtent, m_maxExtent, m_radius;
00089
00090 inline void bindBuffers();
00091 inline void unbindBuffers();
00092 };
00093
00094
00095 #endif