blob: 66b6589e44ef63dfb2ba70dd9c84c77919589859 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "shared/pch.hh"
#include "shared/gravity.hh"
#include "shared/dimension.hh"
#include "shared/globals.hh"
#include "shared/stasis.hh"
#include "shared/velocity.hh"
void GravityComponent::fixed_update(Dimension *dimension)
{
auto fixed_acceleration = globals::fixed_frametime * dimension->get_gravity();
auto group = dimension->entities.group<GravityComponent>(entt::get<VelocityComponent>, entt::exclude<StasisComponent>);
for(auto [entity, velocity] : group.each()) {
velocity.value.y += fixed_acceleration;
}
}
|