⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mobmodel.h

📁 Torus3D.rar,BREW平台的3D游戏引擎的一个实例.喜欢的朋友可以下载
💻 H
字号:
// ==========================================================================================================
//
// BREW v2.0+ OPENGLES MICROENGINE
//
// ----------------------------------------
//
// Written by Vander Nunes
//
// ==========================================================================================================

#ifndef __MOBMODEL_H__

	#define __MOBMODEL_H__

	#include "AEEAppGen.h"
	#include "AEEModGen.h"
	#include "AEEStdLib.h"
	#include "AEEFile.h"
	#include "defines.h"

	#define INC_NORMALS		TRUE
	#define INC_ENVMAP		TRUE

	class CMobModel
	{
		private:

			boolean					m_bZWrite;
			boolean					m_bBackCull;

			dword						m_dwBSphere;		// bounding sphere for culling and collision detection
			vec3_t					m_BBMin;				// minimum bbox coordinates
			vec3_t					m_BBMax;				// maximum bbox coordinates

			// 16:16 x,y,z
			int*						m_pVertices;

			#if INC_NORMALS
				int*					m_pNormals;
				#if INC_ENVMAP
					int*					m_pEnvNormals;
					dword*				m_pEnvTexCoords;
				#endif
			#endif

			// 16:0 indexes
			word*						m_pFaces;

			// 16:16 r,g,b,a
			dword*					m_pColors;

			// 16:16 u,v
			dword*					m_pTexCoords;

			dword						m_dwVertexCount;
			dword						m_dwFaceCount;
			dword						m_dwTexCoords;

		public:

			CMobModel();
			~CMobModel();

			// -----------------------------

			boolean					Load(AEEApplet* pApplet, char *szPakFile, char *szFile, float fXScale, float fYScale, float fZScale);
			void						AllocSpace(uint32 dwVertices, uint32 dwFaces);
			void						MakeSphere(float fRadius, word wDivr, word wDivh, boolean bUseUVHack);

			#if INC_NORMALS
				void						RecalculateNormals(void);
			#endif

			void						SetZWrite(boolean bZWrite);
			boolean					ZWrite();
			void						SetBackCull(boolean bBackCull);
			boolean					BackCull();
			dword						BSphere();
			int*						BBMin();
			int*						BBMax();
			int*						Vertices();
			int*						Vertex(dword dwVertex);
			word*						Faces();
			dword*					Colors();
			dword*					TexCoords();
			dword						VertexCount();
			dword						FaceCount();

			#if INC_NORMALS
				int*					Normals();
				#if INC_ENVMAP
					int*					EnvNormals();
					dword*				EnvTexCoords();
				#endif
			#endif
	};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -