A
download Model.h
Language: C++
LOC: 23
Project Info
TableHockey3D(tablehockey)
Server: SourceForge
Type: cvs
...ey\CVSROOT\tablehockey\src\
   Application.cpp
   Application.h
   Camera.cpp
   Camera.h
   Cube.cpp
   Cube.h
   Data.cpp
   Data.h
   Disk.cpp
   Disk.h
   FloatingText.cpp
   FloatingText.h
   Floor.cpp
   Floor.h
   Input.cpp
   Input.h
   Light.cpp
   Light.h
   log.cpp
   log.h
   main.cpp
   mmgr.cpp
   mmgr.h
   Model.cpp
   Model.h
   nommgr.h
   Puck.cpp
   Puck.h
   Pyramid.cpp
   Pyramid.h
   scene.cpp
   scene.h
   SmartPtr.h
   Sound.cpp
   Sound.h
   TableHockey.dsp
   TableHockey.dsw
   TestScene.cpp
   TestScene.h
   text.cpp
   text.h
   TextHelp.cpp
   TextHelp.h
   texture.cpp
   texture.h
   TexturedCube.cpp
   TexturedCube.h
   timer.cpp
   timer.h
   View.cpp
   View.h

// 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_)

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us