-
Notifications
You must be signed in to change notification settings - Fork 0
/
World.hpp
63 lines (56 loc) · 1.64 KB
/
World.hpp
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
#ifndef WORLD_HPP
#define WORLD_HPP
#include <glm/glm.hpp>
#include <deque>
#include "Util.hpp"
#include "Actors.hpp"
#include "Actor.hpp"
#include "Physics.hpp"
#include "G_Cuboid.hpp"
#include "L_Cuboid.hpp"
#include "P_State.hpp"
#include "Physics.hpp"
#include "Octree.hpp"
#include "AABB.hpp"
#include "Force.hpp"
#include "Deltas.hpp"
#include <memory>
#include "Shot.hpp"
class World {
private:
Actors actors_;
Physics phys_;
Octree tree_;
Forces force_queue_;
Shots shot_queue_;
Shot shot_face(const vv3& verts24, const v3& org, const v3& dir, const int& i);
Shot shot_actor(const v3& org, const v3& dir, const Id& id);
public:
std::map<int,std::unique_ptr<G_Cuboid>> g_cubs;
std::map<int,vv3> l_cub_face_verts;
World(float worldSize, v2 windowSize);
v2 windowSize;
Actors& actors();
//void insert(Actor* a);
void insert(Actor a);
void simulate(
const float& t,
const float& dt,
std::vector<Mom_Pos>& vec_mom_pos,
std::vector<AngMom_Ori>& vec_angmom_ori
);
void apply_force(const Force& force);
void apply_forces(const Forces& forces);
void clear_forces();
void clear_shots();
Forces& forces();
Shots& shots();
void fire_shot(const Id& id);
void fire_shot(const Shot& shot);
Shots fire_shots(const Shots& shots, bool moved=true);
void render();
void collisions();
void blow_up(const Id& id);
std::vector<MTV> colliding_with(const Id& id);
};
#endif