X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_render.h;h=f33e2db6f76faa189d3b444c974535283cb57bd7;hb=ca35eceae3abfcfb9ba266d6ea8e664bc06b0a3e;hp=e9d17bb6c90c2e3817df489a1bc423f2abe36cb8;hpb=1b522daa02f28128498b04def4d60b63e590d1f3;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_render.h b/player_render.h index e9d17bb..f33e2db 100644 --- a/player_render.h +++ b/player_render.h @@ -3,6 +3,8 @@ #include "model.h" #include "skeleton.h" +#include "camera.h" +#include "world.h" struct player_avatar { @@ -24,12 +26,6 @@ struct player_avatar id_board; }; -struct player_model -{ - glmesh mesh; - GLuint texture; -}; - enum eboard_truck{ k_board_truck_back = 0, k_board_truck_front = 1 @@ -42,10 +38,15 @@ enum eboard_wheel{ k_board_wheel_br = 3, }; -struct player_board -{ +/* TODO: Fully featured dynamic models + * This is FAR from the final system we want at all, but it will do for now */ +struct dynamic_model_1texture{ glmesh mesh; GLuint texture; +}; + +struct player_board{ + struct dynamic_model_1texture mdl; v4f wheel_positions[4], truck_positions[2], @@ -56,4 +57,38 @@ struct player_board board; }; +struct board_pose { + f32 lean; +}; + +struct player_model{ + struct dynamic_model_1texture mdl; +}; + +enum board_shader{ + k_board_shader_player, + k_board_shader_entity +}; + +VG_STATIC void dynamic_model_load( mdl_context *ctx, + struct dynamic_model_1texture *mdl, + const char *path ); +VG_STATIC void dynamic_model_unload( struct dynamic_model_1texture *mdl ); + +VG_STATIC void player_board_load( struct player_board *mdl, const char *path ); +VG_STATIC void player_board_unload( struct player_board *mdl ); + +VG_STATIC void player_model_load( struct player_model *board, const char *path); +VG_STATIC void player_model_unload( struct player_model *board ); + +VG_STATIC void render_board( camera *cam, world_instance *world, + struct player_board *board, m4x3f root, + struct board_pose *pose, + enum board_shader shader ); + +VG_STATIC void render_playermodel( camera *cam, world_instance *world, + int depth_compare, + struct player_model *model, + struct skeleton *skeleton ); + #endif /* PLAYER_RENDER_H */