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

#include "shared/entity/velocity.hh"

#include "shared/entity/stasis.hh"
#include "shared/entity/transform.hh"

#include "shared/world/dimension.hh"

#include "shared/globals.hh"

void Velocity::fixed_update(Dimension* dimension)
{
    auto group = dimension->entities.group<Velocity>(entt::get<Transform>, entt::exclude<Stasis>);

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