We need this in addition to the Matrix (which includes translation) - mainly for rotation, which should be around the translation, but not around the origin. There may be some places left which need changes due to this - the line between the origin and translation isn't as clear yet as it should be.
29 lines
745 B
C++
29 lines
745 B
C++
//
|
|
// Created by karl on 04.01.20.
|
|
//
|
|
|
|
#ifndef ECSGAME_POSITIONDEBUGSYSTEM_H
|
|
#define ECSGAME_POSITIONDEBUGSYSTEM_H
|
|
|
|
#include <iostream>
|
|
|
|
#include "../ECS.h"
|
|
#include "../Components/Transform.h"
|
|
|
|
using namespace ECS;
|
|
|
|
class PositionDebugOutputSystem : public EntitySystem {
|
|
public:
|
|
void tick(World *pWorld, float deltaTime) override {
|
|
pWorld->each<Transform>([&](Entity *ent, ComponentHandle<Transform> transform) {
|
|
std::cout << ent->getEntityId() << ": "
|
|
<< transform->get_origin().x << ", "
|
|
<< transform->get_origin().y << ", "
|
|
<< transform->get_origin().z
|
|
<< std::endl;
|
|
});
|
|
}
|
|
};
|
|
|
|
#endif //ECSGAME_POSITIONDEBUGSYSTEM_H
|