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