entity.h (632B)
1 #ifndef ENTITY_H 2 #define ENTITY_H 3 4 #include "vector.h" 5 6 #define ENTITIES_MAX 100 7 8 // TODO: get rid of this or rename it 9 struct Entity 10 { 11 float mass; 12 float size; 13 struct Vec2d position; 14 struct Vec2d velocity; 15 uint32_t color; 16 }; 17 18 struct EntityRender 19 { 20 float size; 21 uint32_t color; 22 }; 23 24 struct EntityPhysical 25 { 26 struct Vec2d velocity; 27 float mass; 28 }; 29 30 struct Entities 31 { 32 struct Vec2d positions[ENTITIES_MAX]; 33 struct EntityRender render[ENTITIES_MAX]; 34 struct EntityPhysical physics[ENTITIES_MAX]; 35 uint32_t num_entities; 36 }; 37 38 void entity_accelerate(struct Entity *e, struct Vec2d *v); 39 40 #endif