fireball.h

来自「《OpenGL游戏编程》这本书的配套源码。」· C头文件 代码 · 共 58 行

H
58
字号
//========================================================
/**
*  @file      FireBall.h
*
*  项目描述: 构造游戏引擎
*  文件描述:  爆炸火花类
*  适用平台: Windows98/2000/NT/XP
*  
*  作者:     WWBOSS
*  电子邮件:  wwboss123@gmail.com
*  创建日期: 2007-07-26	
*  修改日期: 2007-07-26
*
*/ 
//========================================================

#ifndef _FIRE_BALL_H_
#define _FIRE_BALL_H_

#include "texture.h"
#include "billboard.h"

#define MAX_LENGTH 100.0f

/** 爆炸火花类 */
class CFireball  
{
public:
	CFireball();
	~CFireball(){}

	void SetSpeed(float s){speed = s;}
	BOOL canReduceLife(){return canReduce;}
	void Change(vector3d& dest){end_pos = dest;}
	void SetColor(float _r,float _g,float _b){r=_r;g=_g;b=_b;}
	BOOL isRun(){return bRun;}
	void Render();
	void Set(vector3d start , vector3d end);
	BOOL Init(char *filename , float size);



private:
	CTexture texture;
	CBillBoard billboard;

	float m_iSize;
	vector3d start_pos,end_pos,vpos;
	float speed;
	BOOL bRun;
	vector3d orient;
	float r,g,b;
	BOOL canReduce;
	BOOL isArrive;
	int i;
};

#endif

⌨️ 快捷键说明

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