diff options
Diffstat (limited to 'src/entity.h')
-rw-r--r-- | src/entity.h | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/entity.h b/src/entity.h index 0f9ec3d..7d27258 100644 --- a/src/entity.h +++ b/src/entity.h @@ -1,4 +1,5 @@ #include "gameCommon.h" +#include "util.h" #ifndef ENTITY_H #define ENTITY_H @@ -23,19 +24,40 @@ typedef int16_t EntityId; // Id in world. typedef void (*EntityUpdateCb)(Game * game, Entity * entity, EntityId id); typedef void (*EntityDrawCb)(Game * game, Entity * entity, EntityId id); +// Acceleration indeed hehehe. +typedef struct EntityAcceleration { + Vector3 rotationUp; + Vector3 rotationDown; + float speedUp; + float speedDown; +} EntityAcceleration; + +float accelerateValue(float value, float lastValue, float up, float down); +Vector3 accelerateVector3(Vector3 value, Vector3 lastValue, Vector3 up, Vector3 down); + +typedef struct EntityVelocity { + Vector3 velocity; + AxisAngle angularVelocity; + Vector3 stick; // Pilot control stick. + float speed; // Somewhat general use (: +} EntityVelocity; + +EntityVelocity entityVelocityIdentity(); + // This fucker is a entity. typedef struct Entity { EntityType type; Model model; Vector3 position; - Vector3 velocity; - - float angularVelocity; - Vector3 rotationAxis; - Quaternion rotation; + EntityVelocity velocity; + EntityVelocity lastVelocity; + + bool useAcceleration; + EntityAcceleration acceleration; + EntityUpdateCb updateCb; EntityDrawCb drawCb; |