-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengine.h
More file actions
30 lines (23 loc) · 719 Bytes
/
engine.h
File metadata and controls
30 lines (23 loc) · 719 Bytes
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
#ifndef ENGINE_H
#define ENGINE_H
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <vector>
#include <GLFW/glfw3.h>
#include "objects.h"
#include "camera.h"
class PhysicsEngine {
public:
PhysicsEngine (float grav = 9.81) : gravity(grav) {}
void addRigidObject(const RigidBody& obj);
void addSimpleObject(const SimpleBody& obj);
void update(float deltaTime);
void render(const Camera& camera, int windowWidth, int windowHeight);
private:
std::vector<RigidBody> rigidObjects;
std::vector<SimpleBody> simpleObjects;
float gravity;
template <typename T>
void renderObjects(const std::vector<T>& objects, glm::mat4 projectionView);
};
#endif // ENGINE_H