ui frosting info
[carveJwlIkooP6JGAAIwe30JlM.git] / player_render.h
1 #ifndef PLAYER_RENDER_H
2 #define PLAYER_RENDER_H
3
4 #include "model.h"
5 #include "skeleton.h"
6 #include "camera.h"
7 #include "world.h"
8
9 enum eboard_truck{
10 k_board_truck_back = 0,
11 k_board_truck_front = 1
12 };
13
14 enum eboard_wheel{
15 k_board_wheel_fl = 0,
16 k_board_wheel_fr = 1,
17 k_board_wheel_bl = 2,
18 k_board_wheel_br = 3,
19 };
20
21 /* TODO: Fully featured dynamic models
22 * This is FAR from the final system we want at all, but it will do for now */
23 struct dynamic_model_1texture{
24 glmesh mesh;
25 GLuint texture;
26 };
27
28 struct player_board{
29 struct dynamic_model_1texture mdl;
30
31 v4f wheel_positions[4],
32 truck_positions[2],
33 board_position;
34
35 mdl_submesh wheels[4],
36 trucks[2],
37 board;
38 };
39
40 struct player_model{
41 struct dynamic_model_1texture mdl;
42 };
43
44 enum board_shader{
45 k_board_shader_player,
46 k_board_shader_entity
47 };
48
49 static void dynamic_model_load( mdl_context *ctx,
50 struct dynamic_model_1texture *mdl,
51 const char *path, u32 *fixup_table );
52 static void dynamic_model_unload( struct dynamic_model_1texture *mdl );
53
54 static void player_board_load( struct player_board *mdl, const char *path );
55 static void player_board_unload( struct player_board *mdl );
56
57 static void player_model_load( struct player_model *board, const char *path);
58 static void player_model_unload( struct player_model *board );
59
60 static void render_board( camera *cam, world_instance *world,
61 struct player_board *board, m4x3f root,
62 struct player_board_pose *pose,
63 enum board_shader shader );
64
65 static void render_playermodel( camera *cam, world_instance *world,
66 int depth_compare,
67 struct player_model *model,
68 struct skeleton *skeleton,
69 m4x3f *final_mtx );
70 static void apply_full_skeleton_pose( struct skeleton *sk, player_pose *pose,
71 m4x3f *final_mtx );
72 static void lerp_player_pose( player_pose *pose0, player_pose *pose1, f32 t,
73 player_pose *posed );
74
75 #endif /* PLAYER_RENDER_H */