-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPAIAnt.cpp
More file actions
69 lines (56 loc) · 1.42 KB
/
PAIAnt.cpp
File metadata and controls
69 lines (56 loc) · 1.42 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
66
67
68
69
// ---------------------------------------------------------------------
// PAIAnt Implementation
// ---------------------------------------------------------------------
#include "PAIAnt.h"
using namespace std;
using namespace CoreStructures;
// ---------------------------------------------------------------------
// PRIVATE
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// PUBLIC
// ---------------------------------------------------------------------
// Constructor
PAIAnt::PAIAnt()
{
carrying = -1;
colour = -1;
}
// Deconstructor
PAIAnt::~PAIAnt()
{
// Empty
}
// Initialise
// Precondition: N/A
// Postcondition: Ant setup/texture loaded/scaled
void PAIAnt::Initialise()
{
// Initialise
ant.Initialise();
ant.setTexture(L"Resources\\Textures\\ant.png");
ant.setScale(GUVector4(0.5, 2.0, 0.5));
}
// Render
// Precondition: Camera matrix
// Postcondition: PBox - render called
void PAIAnt::Render(const CoreStructures::GUMatrix4& T)
{
// Slight offset to centre ants in grid
GUMatrix4 MVP = T * GUMatrix4::translationMatrix(0.25, 0.0, 0.25);
// Render box
ant.Render(MVP);
}
// Getters and Setters
GUVector4 PAIAnt::getPosition()
{
return ant.getPosition();
}
void PAIAnt::setPosition(CoreStructures::GUVector4 pos)
{
ant.setPosition(pos);
}
void PAIAnt::setPosition(float x, float y, float z)
{
ant.setPosition(x, y, z);
}