entity.h

来自「一本关于OPenGL的很好的电子书」· C头文件 代码 · 共 53 行

H
53
字号
#ifndef __ENTITY_H
#define __ENTITY_H

/*
	ENTITY.H

	The CEntity class

	Author: Kevin Hawkins
	Date: 3/29/2001
	Description: The CEntity class is derived from CMD2Model and
			   provides the functionality of an entity in the
			   game world. It holds the current MD2 animation
			   state, the entity angle heading, and the entity's
			   primary sound.

*/

#include <stdlib.h>
#include <time.h>
#include <typeinfo.h>

#include "md2.h"
#include "object.h"
#include "camera.h"
#include "audiosystem.h"
#include "terrain.h"

class CEntity : public CMD2Model
{
protected:
     void OnAnimate(float deltaTime);
     void OnDraw(CCamera *camera);
     void OnCollision(CObject *collisionObject);
     void OnPrepare();

public:
     float direction;         // angle the entity is facing (in radians)
     CAudio *entitySound;     // the sound the entity makes
                              // currently only supports one sound
                              // per entity

     CEntity();
     ~CEntity();

     int stateStart, stateEnd;     // state keyframe start/end
     float deltaT;
     float animSpeed;

     void LoadAudio(CAudioSystem *audioSystem, char *filename, bool is3DSound);
};

#endif

⌨️ 快捷键说明

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