fixed compil and finished moving files to the game

This commit is contained in:
Clément Le Bihan
2021-05-24 11:46:52 +02:00
parent 3d5ea204b6
commit 269ec94412
12 changed files with 71 additions and 53 deletions
+7 -7
View File
@@ -3,26 +3,26 @@
//
#include "Component/Position/PositionComponent.hpp"
#include "System/Movable/MovableSystem.hpp"
#include "MovableSystem.hpp"
#include "Component/Movable/MovableComponent.hpp"
#include "Wal.hpp"
namespace WAL
namespace BBM
{
MovableSystem::MovableSystem()
: System({
: WAL::System({
typeid(MovableComponent),
typeid(PositionComponent)
})
{}
void MovableSystem::onFixedUpdate(Entity &entity)
void MovableSystem::onFixedUpdate(WAL::Entity &entity)
{
auto &movable = entity.getComponent<MovableComponent>();
auto &position = entity.getComponent<PositionComponent>();
position.position += movable._velocity * Wal::timestep.count();
movable._velocity = movable._acceleration * Wal::timestep.count();
movable._acceleration = Vector3f();
position.position += movable._velocity * WAL::Wal::timestep.count();
movable._velocity = movable._acceleration * WAL::Wal::timestep.count();
movable._acceleration = WAL::Vector3f();
}
}