summaryrefslogtreecommitdiff
path: root/src/entity.h
blob: f15b0403e9905d4ed6215be4ff2b156d0af51260 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef ENTITY_H
#define ENTITY_H

#include "vector.h"

#define ENTITIES_MAX 100

// TODO: get rid of this or rename it
struct Entity
{
    float mass;
    float size;
    struct Vec2d position;
    struct Vec2d velocity;
    uint32_t color;
};

struct EntityRender
{
    float size;
    uint32_t color;
};

struct EntityPhysical
{
    struct Vec2d velocity;
    float mass;
};

struct Entities
{
    struct Vec2d positions[ENTITIES_MAX];
    struct EntityRender render[ENTITIES_MAX];
    struct EntityPhysical physics[ENTITIES_MAX];
    uint32_t num_entities;
};

void entity_accelerate(struct Entity *e, struct Vec2d *v);

#endif