summaryrefslogtreecommitdiffstats
path: root/src/game/shared/entity/velocity.cc
blob: 86df44565a9ab5f3241c5489f7a19d299efe0dae (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 entity::Velocity::fixed_update(world::Dimension* dimension)
{
    auto group = dimension->entities.group<entity::Velocity>(entt::get<entity::Transform>, entt::exclude<entity::Stasis>);

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