-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhysicsSystem.h
More file actions
38 lines (29 loc) · 896 Bytes
/
PhysicsSystem.h
File metadata and controls
38 lines (29 loc) · 896 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
31
32
33
34
35
36
37
#pragma once
#include <unordered_map>
#include <vector>
#include "BaseComponentSystem.h"
#include <reactphysics3d/reactphysics3d.h>
class PhysicsComponent;
using namespace reactphysics3d;
class PhysicsSystem
{
public:
typedef std::string String;
typedef std::unordered_map<String, PhysicsComponent*> ComponentTable;
typedef std::vector<PhysicsComponent*> ComponentList;
PhysicsSystem();
~PhysicsSystem();
void registerComponent(PhysicsComponent* component);
void unregisterComponent(PhysicsComponent* component);
void unregisterComponentByName(String name);
PhysicsComponent* findComponentByName(String name);
ComponentList getAllComponents();
void updateAllComponents();
PhysicsWorld* getPhysicsWorld();
PhysicsCommon* getPhysicsCommon();
private:
ComponentTable componentTable;
ComponentList componentList;
PhysicsCommon* physicsCommon;
PhysicsWorld* physicsWorld;
};