-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathShooterGameTarget.h
57 lines (46 loc) · 1.37 KB
/
ShooterGameTarget.h
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
// Copyright 2009 Isis Innovation Limited
//
// C++ Interface: ShooterGameTarget
//
// Description: A target class for the shooter game
//
//
// Author: Robert Castle <bob@robots.ox.ac.uk>, (C) 2009
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef PTAMMSHOOTERGAMETARGET_H
#define PTAMMSHOOTERGAMETARGET_H
#include <vector>
#include <TooN/TooN.h>
#include "OpenGL.h"
namespace PTAMM {
class TiXmlElement;
/**
* A target for the shooter game.
* @author Robert Castle <bob@robots.ox.ac.uk>
*/
class ShooterGameTarget
{
public:
ShooterGameTarget( TooN::Vector<3> v3Loc, const GLuint & nSphereDisplayList );
~ShooterGameTarget() {};
void Draw();
void Update();
bool HitCheck( TooN::Vector<3> v3Pos );
int & Strength() { return mnStrength; } /// Get or set the strength of the target
void Save( TiXmlElement * targetsNode );
void Load( TiXmlElement * targetsNode );
private:
void _AssignProperties();
private:
const GLuint & mnSphereDisplayList; // The sphere display list
float mafColor[3]; // Its colour
TooN::Vector<3> v3Position; // Its location in the world
double mdScale; // Its scale
double mdGrowthRate; // Its growth rate
int mnStrength; // Its health
};
}
#endif