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

📄 mcmesh.h

📁 国外网游源码....除工具源码缺少之外,其余程序都全...至于,什么游戏,因为国内还没有,所以找不到测试
💻 H
字号:
// MCMesh.h: interface for the CMCMesh class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MCMESH_H__B6DC3A12_962F_4573_A973_A62EBDC91ABF__INCLUDED_)
#define AFX_MCMESH_H__B6DC3A12_962F_4573_A973_A62EBDC91ABF__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define MAX_BONEANI		6

struct MCBONMESHFACE{
	WORD	nFace[3];
	MCBONMESHFACE()
	{
	}
};

struct MCFVFVERTEX
{
	D3DXVECTOR3 vVector;
	D3DXVECTOR3 vNoraml;
	D3DXVECTOR2 Tex;
};

#define MC3FVF_VERTEX (D3DFVF_XYZ | D3DFVF_NORMAL|D3DFVF_TEX1 )

//struct MCFVFSHADOWVERTEX
//{
//	D3DXVECTOR3 vVector;
//	D3DXVECTOR3 vNoraml;
//	D3DXVECTOR2 Tex;
//};
//
//#define MC3FVF_VERTEX (D3DFVF_XYZ | D3DFVF_NORMAL|D3DFVF_TEX1 )


//----------------------------------------------------------------------------------//
// md3 BoundBox
typedef struct 
{
	// 恐 3俺究 老鳖 -> x,y,z
	D3DXVECTOR3 vMins;		// 官款爹 冠胶狼 霉锅掳 葛劈捞,  / 盔巩(first corner of the bounding box)
	D3DXVECTOR3 vMaxs;		// 官款爹 冠胶狼 滴锅掳 葛劈捞,  / 盔巩(second corner of the bounding box)
	D3DXVECTOR3 Position;		// 官款爹冠胶狼 吝缴谅钎(origin) / 盔巩(position/origin of the bounding box)
	float scale;			// 官款爹备狼 扼叼快胶蔼?		 / 盔巩(radius of bounding sphere)
	char name[16];			// 脚版镜鞘夸 绝澜.
}MD3BOUNDBOX;

class CMCAni;

class CMCMesh  
{
public:
	CMCMesh();
	virtual ~CMCMesh();

public:
	void				AddTexture( MCTEXTURE * pTexture, int nCount );
	//void				AddAniMatrix( CMCAni * pAni );
	void				AddAniMatrix( CMCAni * pAni, BYTE nIndex );
	HRESULT				CreateVertexIndexBuffer();
	HRESULT				CreateVertexIndexBufferEx();
	HRESULT				CreateBoundBox( BYTE nIndex );
	HRESULT				ReleaseVertexIndex();
	HRESULT				UpdateAnimation(UINT nCurFrame, UINT nNextFrame, float fInterPolation, BYTE nIndex);
	HRESULT				UpdateAnimationEx(UINT nCurFrame, UINT nNextFrame, float fInterPolation, BYTE nIndex);
	HRESULT				Render( UINT nCurFrame, UINT nNextFrame, float fInterPolation, BYTE nIndex );
	HRESULT				RenderEx(D3DXMATRIX matWorld, UINT nCurFrame, UINT nNextFrame, float fInterPolation, BYTE nIndex );
	void				BoundingBoxRender(DWORD dwCurFrame, D3DXMATRIX& matWorld, BYTE nIndex);
	void				GetVertexBuffer(LPDIRECT3DVERTEXBUFFER9 *ppVB)		{ *ppVB = m_pVertexBuffer; }
	void				GetIndexBuffer(LPDIRECT3DINDEXBUFFER9 *ppIB)		{ *ppIB = m_pIndexBuffer; }
	MD3BOUNDBOX*		GetBoundBox(DWORD dwCurFrame,BYTE nIndex) { return &m_pBoundBox[nIndex][dwCurFrame]; }
	LPD3DXMESH			GetD3DXBox() { return m_pD3DXMesh; }	// D3DXMesh肺 父甸绢柳 冠胶

	CMCAni *			GetAni( UINT nCurFrame, BYTE nIndex ) { return m_vlAniMation[nIndex][nCurFrame]; }
	D3DXMATRIX			GetWorldMatrix(){ return m_matWorld; }

public:
	char				m_szName[68];
	int					m_nVertexCount;
	int					m_nFaceCount;
	int					m_nTexCount;
	int					m_bNegScale;

	D3DXMATRIX			m_matWorld;

	MCTEXTURE **		m_pTexture;

	MCFVFVERTEX	*		m_pMCVertex;
//	MCFVFVERTEX	*		m_pSysMemMesh;		// 皋葛府 汗荤侩..
//	MCBONMESHFACE *		m_stFace;
	WORD *				m_nFace;
	DWORD	*			m_nTexIndex;
	D3DXVECTOR3			m_vPos;
	
	BOOL				m_bRender;

	D3DXMATRIXA16		m_matParentTrans;
	D3DXMATRIXA16		m_matParentRotate;
	D3DXMATRIXA16		m_matParentScale;
	D3DXMATRIXA16		m_matParentWorld;
	MD3BOUNDBOX *		m_pBoundBox[MAX_BONEANI];
	int					m_nMaxFrame[MAX_BONEANI];
	
	BYTE				m_nDamage;
	BYTE				m_nParts;

private:

	LPDIRECT3DVERTEXBUFFER9		m_pVertexBuffer;
	LPDIRECT3DINDEXBUFFER9		m_pIndexBuffer;

	//CMCAni *					m_pAniMation;
	vector<CMCAni *>			m_vlAniMation[MAX_BONEANI];
	LPD3DXMESH					m_pD3DXMesh;
	//vector<LPD3DXMESH>			m_pD3DXMesh[MAX_BONEANI];
};

#endif // !defined(AFX_MCMESH_H__B6DC3A12_962F_4573_A973_A62EBDC91ABF__INCLUDED_)

⌨️ 快捷键说明

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