the luxuries of a modern C compiler
[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 struct player_model
30 {
31 glmesh mesh;
32 GLuint texture;
33 };
34
35 enum eboard_truck{
36 k_board_truck_back = 0,
37 k_board_truck_front = 1
38 };
39
40 enum eboard_wheel{
41 k_board_wheel_fl = 0,
42 k_board_wheel_fr = 1,
43 k_board_wheel_bl = 2,
44 k_board_wheel_br = 3,
45 };
46
47 struct player_board
48 {
49 glmesh mesh;
50 GLuint texture;
51
52 v4f wheel_positions[4],
53 truck_positions[2],
54 board_position;
55
56 mdl_submesh wheels[4],
57 trucks[2],
58 board;
59 };
60
61 enum board_shader{
62 k_board_shader_player,
63 k_board_shader_entity
64 };
65
66 VG_STATIC void player_board_load( struct player_board *mdl, const char *path );
67 VG_STATIC void player_board_unload( struct player_board *mdl );
68 VG_STATIC void render_board( camera *cam, world_instance *world,
69 struct player_board *board, m4x3f root,
70 enum board_shader shader );
71
72 #endif /* PLAYER_RENDER_H */