blob: c24afa2eba8faa97438cfa4a424b746a1c24bb30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include "PhysicsSystem.h"
#include "ComponentManager.h"
#include "Rigidbody.h"
#include "Transform.h"
#include <iostream>
using namespace crepe;
PhysicsSystem::PhysicsSystem() {
}
void PhysicsSystem::update() {
ComponentManager& mgr = ComponentManager::get_instance();
std::vector<std::reference_wrapper<Rigidbody>> rigidbodies = mgr.get_components_by_type<Rigidbody>();
std::vector<std::reference_wrapper<Transform>> transforms = mgr.get_components_by_type<Transform>();
for (Rigidbody& rigidbody : rigidbodies) {
std::cout << rigidbody.gameObjectId << std::endl;
}
}
|