-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathentity.h
More file actions
65 lines (51 loc) · 1.73 KB
/
Copy pathentity.h
File metadata and controls
65 lines (51 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*******************************************************************************/
/** \file entity.h
\brief Contains the CEntity class
\author Kevin Hawkins
\date 3/29/2001
********************************************************************************/
#ifndef __ENTITY_H
#define __ENTITY_H
#include <windows.h>
#include <stdlib.h>
#include <time.h>
#include <typeinfo>
#include "md2.h"
#include "object.h"
#include "camera.h"
#include "audiosystem.h"
#include "terrain.h"
/*******************************************************************************/
/** \class CEntity
\brief Provides the functionality of an entity in the game world
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.
********************************************************************************/
class CEntity : public CMD2Model
{
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera);
void OnCollision(CObject *collisionObject);
void OnPrepare();
void PlaySound() { audioSys->Play(entitySound, false); }
public:
/** angle the entity is facing (in radians) */
float direction;
/** the sound the entity makes currently only supports
one sound per entity */
CAudio *entitySound;
/** a pointer to the audio system */
CAudioSystem *audioSys;
CEntity();
~CEntity();
int stateStart, stateEnd; // state keyframe start/end
float deltaT;
float animSpeed;
void LoadAudio(CAudioSystem *audioSystem, char *filename, bool is3DSound);
void SetAudioSystem(CAudioSystem *asys) { audioSys = asys; }
};
#endif