clear runs when respawning
[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 struct player_avatar
10 {
11 mdl_context meta;
12 struct skeleton sk;
13
14 u32 id_hip,
15 id_ik_hand_l,
16 id_ik_hand_r,
17 id_ik_elbow_l,
18 id_ik_elbow_r,
19 id_head,
20 id_ik_foot_l,
21 id_ik_foot_r,
22 id_ik_knee_l,
23 id_ik_knee_r,
24 id_wheel_l,
25 id_wheel_r,
26 id_board;
27 };
28
29 enum eboard_truck{
30 k_board_truck_back = 0,
31 k_board_truck_front = 1
32 };
33
34 enum eboard_wheel{
35 k_board_wheel_fl = 0,
36 k_board_wheel_fr = 1,
37 k_board_wheel_bl = 2,
38 k_board_wheel_br = 3,
39 };
40
41 /* TODO: Fully featured dynamic models
42 * This is FAR from the final system we want at all, but it will do for now */
43 struct dynamic_model_1texture{
44 glmesh mesh;
45 GLuint texture;
46 };
47
48 struct player_board{
49 struct dynamic_model_1texture mdl;
50
51 v4f wheel_positions[4],
52 truck_positions[2],
53 board_position;
54
55 mdl_submesh wheels[4],
56 trucks[2],
57 board;
58 };
59
60 struct player_model{
61 struct dynamic_model_1texture mdl;
62 };
63
64 enum board_shader{
65 k_board_shader_player,
66 k_board_shader_entity
67 };
68
69 VG_STATIC void dynamic_model_load( mdl_context *ctx,
70 struct dynamic_model_1texture *mdl,
71 const char *path );
72 VG_STATIC void dynamic_model_unload( struct dynamic_model_1texture *mdl );
73
74 VG_STATIC void player_board_load( struct player_board *mdl, const char *path );
75 VG_STATIC void player_board_unload( struct player_board *mdl );
76
77 VG_STATIC void player_model_load( struct player_model *board, const char *path);
78 VG_STATIC void player_model_unload( struct player_model *board );
79
80 VG_STATIC void render_board( camera *cam, world_instance *world,
81 struct player_board *board, m4x3f root,
82 struct player_board_pose *pose,
83 enum board_shader shader );
84
85 VG_STATIC void render_playermodel( camera *cam, world_instance *world,
86 int depth_compare,
87 struct player_model *model,
88 struct skeleton *skeleton );
89
90 #endif /* PLAYER_RENDER_H */