-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtank.h
40 lines (33 loc) · 1.1 KB
/
tank.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
#ifndef TANK
#define TANK
#include "globals.h"
#include <math.h>
#include <vector>
#include <sstream>
#include "projectile.h"
#include "glm.h"
class Projectile;
class Tank:public DrawableObject{
private:
float colorR, colorG, colorB;
public:
Point hitSphereCenter;
double hitSphereRadius;
double baseAngle, towerAngle, cannonAngle, scale;
bool laser, tankRecoil;
double tankSpeedX, tankSpeedY, tankSpeed, recoilSpeed, recoilAngle, towerToBaseAngle;
double rollingFriction, kineticFriction;
int cooldown;
int health;
std::vector<Polygon3d> base, tower, cannon;
std::vector<Polygon3d> baseBoundingBox, towerBoundingBox, cannonBoundingBox;
Tank(Point center);
void draw();
void shoot();
void applyRecoil();
void update(double tankBaseRotate, double tankTurretRotate, double tankCannonRotate, int cameraMode, double tankAccel); // make the pendulum keep up with the frame rate
bool onLock(int x, int y);
void turretFollowMouse(int x, int y, int cameraMode);//turret + cannon follow mouse cursor
std::vector<Polygon3d> getBoundingBox(void);//return vector of vectors of individual bounding boxes
};
#endif