-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame_World.h
80 lines (53 loc) · 1.66 KB
/
Game_World.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// Game_World.h
// game
//
// Created by Xinyuan Huang on 10/20/13.
//
//
#ifndef __game__Game_World__
#define __game__Game_World__
#include "Disk.h"
#include "Wall.h"
#include "Ball.h"
#include "Home.h"
#include <zenilib.h>
#include <Zeni/Collision.h>
#include <Zeni/Model.h>
#include <Zeni/Quaternion.h>
#include <Zeni/Sound.h>
#include <Zeni/Vector3f.h>
#include <Zeni/Collision.h>
#include <vector>
#include <vector>
#include <deque>
#include <string>
class Game_World {
public:
Game_World();
Game_World(const Game_World &rhs) = delete;
Game_World & operator=(const Game_World &rhs) = delete;
~Game_World();
void render();
bool collide(Ball &ball, const Zeni::Point3f backup_position, bool should_bounce);
Zeni::Point3f get_plane_position(const Zeni::Collision::Sphere &ball);
void tilt(const float &forward, const float &leftward);
void read_disk_positions(std::string filename);
void read_wall_positions(std::string filename);
void update_view(const Zeni::Point3f &camera_position);
Zeni::Point3f reset(); // return the ball's position to reset to
float get_ideal_camera_height();
bool is_home(Zeni::Point3f ball_pos);
private:
//void create_body();
// Level 1
/*static Zeni::Model * m_model;
static unsigned long m_instance_count;*/
std::deque<Disk> disks_in_view;
std::vector<Zeni::Point3f> disk_positions; // sorted by y
//std::vector<Wall*> m_walls;
std::deque<Wall> walls_in_view;
std::vector<Zeni::Point3f> wall_positions;
Home *m_home;
};
#endif /* defined(__game__Game_World__) */