summaryrefslogtreecommitdiffstats
path: root/src/game/shared/velocity.cc
blob: 329dc91c5cd3d97b95ca5012e988ad4d3bae1b65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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;
    }
}