diff options
author | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-07-13 20:57:32 -0600 |
---|---|---|
committer | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-07-13 20:57:32 -0600 |
commit | 9eeb5293fc0d022298fb772338241aa7e8672dac (patch) | |
tree | d6ddbaf8f0398d6c83125a64a8c42e1c71ea48b4 /src/entities/mussolini.c | |
parent | f368f2811a3f8ca0a4b9572b300358bd17d8dac1 (diff) |
Half working mussolini
Diffstat (limited to 'src/entities/mussolini.c')
-rw-r--r-- | src/entities/mussolini.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/entities/mussolini.c b/src/entities/mussolini.c new file mode 100644 index 0000000..2770d2f --- /dev/null +++ b/src/entities/mussolini.c @@ -0,0 +1,34 @@ +#include "mussolini.h" +#include "assets.h" +#include "game.h" + +void initMussolini(Entity * entity, Game * game) { + entity->model = &game->assets.models[MUSSOLINI_ASSET]; +} + +void closeMussolini(Entity * entity) { +} + +void updateMussolini(Game * game, Entity * entity) { + Entity * player = getEntityFromWorld(game->world, 0); + + float pitch = Vector2Angle( + (Vector2){entity->position.y, entity->position.x}, + (Vector2){player->position.y, player->position.x} + ); + + float yaw = Vector2Angle( + (Vector2){entity->position.x, entity->position.z}, + (Vector2){player->position.x, player->position.z} + ); + + entity->rotation = QuaternionFromEuler( + pitch - (PI/2), + -(yaw - (PI/2)), + 0.0 + ); +} + +void drawMussolini(Game * game, Entity * entity) { + entityDraw(entity); +} |