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

📄 attachment.h

📁 3D游戏展示程序
💻 H
字号:
//--------------------------------------------------
//  Desc: M2 Attachment
//  Date: 2007.4.16 /update
//  Author: Artsylee
//
//  From: WOW Model Viewer
//  I just coding in my own ways!
//
//--------------------------------------------------

#ifndef _ATTACHMENT
#define _ATTACHMENT

#include <vector>
#include <d3dx9.h>
class CM2Loader;

class Attachment
{
public:
	Attachment();
	~Attachment();

	bool Load(Attachment *pParent, CM2Loader *pModel, int BoneId, int Slot);
	void Update(void);
	void Render(void);
	void UpdateParticle(void);
	void RenderParticle(const D3DXMATRIX &matRotate);

	void SetScale(float scale);
	void SetRotate(const D3DXVECTOR3 &rotate);
	void SetPosition(const D3DXVECTOR3 &pos);
	void SetRender(bool bRender);

	void ReleaseChildren(void);
	Attachment* AddChild(const char *filename, int id, int slot, float scale = 1.0f, 
		D3DXVECTOR3 rotate = D3DXVECTOR3(0.0f, 0.0f, 0.0f), 
		D3DXVECTOR3 pos = D3DXVECTOR3(0.0f, 0.0f, 0.0f));

	Attachment* AddChild(CM2Loader *model, int id, int slot, float scale = 1.0f,
		D3DXVECTOR3 rotate = D3DXVECTOR3(0.0f, 0.0f, 0.0f), 
		D3DXVECTOR3 pos = D3DXVECTOR3(0.0f, 0.0f, 0.0f));
	void ReleaseSlot(int slot);

private:
	int			m_BoneID;
	int			m_Slot;

	float		m_Scale;
	D3DXVECTOR3 m_Rotate;
	D3DXVECTOR3 m_Position;
private:
	Attachment*	m_pParent;
public:
	CM2Loader*	m_pModel;
	std::vector<Attachment*> m_Children;
};

#endif // _ATTACHMENT

⌨️ 快捷键说明

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