aboutsummaryrefslogtreecommitdiff
path: root/src/entity.h
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 23:10:23 -0600
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 23:10:23 -0600
commite5268813dcbdc0d90a081b2223ebc21749038635 (patch)
tree7c917996749e4123fb1fe49ddd1ed3b8f7e92334 /src/entity.h
parenta90e1987de75cfecc2693952625af8cce507ae95 (diff)
Better world
Diffstat (limited to 'src/entity.h')
-rw-r--r--src/entity.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/entity.h b/src/entity.h
index 7d27258..128365f 100644
--- a/src/entity.h
+++ b/src/entity.h
@@ -19,6 +19,7 @@ enum {
typedef int8_t EntityType;
typedef int16_t EntityId; // Id in world.
+typedef uint32_t EntityFingerprint;
// Callbacks.
typedef void (*EntityUpdateCb)(Game * game, Entity * entity, EntityId id);
@@ -26,8 +27,7 @@ typedef void (*EntityDrawCb)(Game * game, Entity * entity, EntityId id);
// Acceleration indeed hehehe.
typedef struct EntityAcceleration {
- Vector3 rotationUp;
- Vector3 rotationDown;
+ Vector3 rotation;
float speedUp;
float speedDown;
} EntityAcceleration;
@@ -46,8 +46,10 @@ EntityVelocity entityVelocityIdentity();
// This fucker is a entity.
typedef struct Entity {
+ EntityId id;
+ EntityFingerprint fingerprint;
EntityType type;
- Model model;
+ Model * model;
Vector3 position;
Quaternion rotation;
@@ -65,7 +67,7 @@ typedef struct Entity {
void * data;
} Entity;
-typedef void (*EntityInitCb)(Entity * entity);
+typedef void (*EntityInitCb)(Entity * entity, Game * game);
typedef void (*EntityCloseCb)(Entity * entity);
// Info for each entity type.
@@ -79,7 +81,7 @@ typedef struct EntityTypeInfo {
const extern EntityTypeInfo entityTypeInfo[ENTITY_TYPE_COUNT];
// Do I need a fucking comment?
-Entity createEntity(EntityType type);
+Entity createEntity(EntityType type, Game * game);
void closeEntity(Entity * entity);
// Helper functions for updating and drawing.