summaryrefslogtreecommitdiffstats
path: root/game/shared/velocity.cc
blob: 6305363a58c0e2f1653f6226f2132ecb3c2dd142 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "shared/pch.hh"
#include "shared/velocity.hh"

#include "shared/dimension.hh"
#include "shared/globals.hh"
#include "shared/stasis.hh"
#include "shared/transform.hh"

void VelocityComponent::fixed_update(Dimension *dimension)
{
    auto group = dimension->entities.group<VelocityComponent>(entt::get<TransformComponent>, entt::exclude<StasisComponent>);

    for(auto [entity, velocity, transform] : group.each()) {
        transform.local += velocity.value * globals::fixed_frametime;
    }
}