From e5268813dcbdc0d90a081b2223ebc21749038635 Mon Sep 17 00:00:00 2001 From: nathansmithsmith Date: Fri, 7 Jul 2023 23:10:23 -0600 Subject: Better world --- src/entity.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/entity.h') 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. -- cgit v1.2.3