// Model.h: interface for the CModel class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MODEL_H__CBA6FB26_9DD5_11D4_A9EA_00105A2EAD2D__INCLUDED_)
#define AFX_MODEL_H__CBA6FB26_9DD5_11D4_A9EA_00105A2EAD2D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// includes most of the necessary headers and defines important externs
#include "application.h"
/**
* CModel is the base class for all objects.
*
* Use this class to create your own objects e.g. cubes, spheres
* or more advanced objects. The function "Draw" is called whenever
* the screen is updated. Check "CTexturedCube" or "CFloor" how to
* attach textures to a model.
*/
class CModel
{
public:
CModel();
virtual ~CModel();
/// pure virtual function which must be implemented in the derived class
virtual void Draw() = 0;
/// set the position of the model
void SetPosition(float x, float y, float z) {pos_x = x; pos_y = y; pos_z = z;}
/// set the rotation of the model
void SetRotation(float a, float x=1.0, float y=1.0, float z=1.0)
{rot_angle = a; rot_x = x; rot_y = y; rot_z = z;}
/// toggle the use of textures
void ToggleTextures() { Toggle(bTexture);}
// position
float pos_x, pos_y, pos_z;
// rotation vectors
float rot_x, rot_y, rot_z;
// rotation angle
float rot_angle;
protected:
/// use textures or not
bool bTexture;
};
#endif // !defined(AFX_MODEL_H__CBA6FB26_9DD5_11D4_A9EA_00105A2EAD2D__INCLUDED_)