?? model.h
字號:
// Model.h: interface for the Model class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MODEL_H__E1E40BB7_CEB8_4CF8_A4F9_3B854BE7322D__INCLUDED_)
#define AFX_MODEL_H__E1E40BB7_CEB8_4CF8_A4F9_3B854BE7322D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Texture.h"
class Model
{
public:
// Mesh
struct Mesh
{
int m_materialIndex;
int m_numTriangles;
int *m_pTriangleIndices;
};
// Material properties
struct Material
{
float m_ambient[4], m_diffuse[4], m_specular[4], m_emissive[4];
float m_shininess;
GLuint m_texture;
char *m_pTextureFilename;
};
// Triangle structure
struct Triangle
{
float m_vertexNormals[3][3];
float m_s[3], m_t[3];
int m_vertexIndices[3];
};
// Vertex structure
struct Vertex
{
char m_boneID; // for skeletal animation
float m_location[3];
};
public:
Model();
virtual ~Model();
/*
Load the model data into the private variables.
filename Model filename
*/
virtual bool loadModelData( const char *filename ) = 0;
/*
Draw the model.
*/
void draw();
/*
Called if OpenGL context was lost and we need to reload textures, display lists, etc.
*/
void reloadTextures();
Texture m_texture;
protected:
// Meshes used
int m_numMeshes;
Mesh *m_pMeshes;
// Materials used
int m_numMaterials;
Material *m_pMaterials;
// Triangles used
int m_numTriangles;
Triangle *m_pTriangles;
// Vertices Used
int m_numVertices;
Vertex *m_pVertices;
};
#endif // !defined(AFX_MODEL_H__E1E40BB7_CEB8_4CF8_A4F9_3B854BE7322D__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -