Subastra
Loading...
Searching...
No Matches
physics.h
Go to the documentation of this file.
1#ifndef __H__SYSTEMS_PHYSICS__
2#define __H__SYSTEMS_PHYSICS__
3
4#include "require.h"
5
7 allocator_t temporary_allocator) {
9 while (entity_iter_next(&it)) {
11 // TODO: overflow the position correctly
13 *v = vec2_add(*v, vec2_scale(*v, payload.delta_time));
14 printf("%f %f\n", v->x, v->y);
15 }
16}
17
19 .name = "system_integrate_velocity",
20 .dependencies = 0,
21 .dependency_count = 0,
22 .entities_const = 0,
23 .entities_mut = ENTITY_KIND_CONSTRUCT,
25 .resources = SYSTEM_RESOURCE_MASK_WORLD,
27
28#endif
#define ASSERT__(expr)
Definition defs.h:21
@ ENTITY_KIND_CONSTRUCT
Definition entity.h:36
static void system_integrate_velocity(system_payload_t payload, allocator_t temporary_allocator)
Definition physics.h:6
static system_requirements_declaration_t system_decl_integrate_velocity
Definition physics.h:18
static entity_iter_t system_payload_entity_iter(system_payload_t *payload)
Definition require.h:201
@ SYSTEM_RESOURCE_MASK_WORLD
Definition require.h:68
@ SYSTEM_PHASE_FIXED_UPDATE
Definition require.h:13
A generic allocator type passed by value. Contains a fallback allocator and a set of function pointer...
Definition memory.h:30
vec2 velocity
Definition construct.h:69
Definition world.h:111
entity_t * entity
Definition world.h:114
construct_t as_construct
Definition entity.h:53
entity_kind_t kind
Definition entity.h:44
Definition require.h:51
double delta_time
Definition require.h:60
Definition require.h:89
const char * name
Definition require.h:90
Definition vec2.h:11
float y
Definition vec2.h:12
float x
Definition vec2.h:12
static bool entity_iter_next(entity_iter_t *it)
Definition world.h:137