performance measurements
[carveJwlIkooP6JGAAIwe30JlM.git] / player_render.h
index e9d17bb6c90c2e3817df489a1bc423f2abe36cb8..21a53b715439830c4627e61a1ad1d32788ba6942 100644 (file)
@@ -3,32 +3,8 @@
 
 #include "model.h"
 #include "skeleton.h"
-
-struct player_avatar
-{
-   mdl_context meta;
-   struct skeleton sk;
-
-   u32 id_hip,
-       id_ik_hand_l,
-       id_ik_hand_r,
-       id_ik_elbow_l,
-       id_ik_elbow_r,
-       id_head,
-       id_ik_foot_l,
-       id_ik_foot_r,
-       id_ik_knee_l,
-       id_ik_knee_r,
-       id_wheel_l,
-       id_wheel_r,
-       id_board;
-};
-
-struct player_model
-{
-   glmesh mesh;
-   GLuint texture;
-};
+#include "camera.h"
+#include "world.h"
 
 enum eboard_truck{
    k_board_truck_back = 0,
@@ -42,10 +18,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 +37,39 @@ struct player_board
                board;
 };
 
+struct player_model{
+   struct dynamic_model_1texture mdl;
+};
+
+enum board_shader{
+   k_board_shader_player,
+   k_board_shader_entity
+};
+
+static void dynamic_model_load( mdl_context *ctx,
+                                   struct dynamic_model_1texture *mdl, 
+                                   const char *path, u32 *fixup_table );
+static void dynamic_model_unload( struct dynamic_model_1texture *mdl );
+
+static void player_board_load( struct player_board *mdl, const char *path );
+static void player_board_unload( struct player_board *mdl );
+
+static void player_model_load( struct player_model *board, const char *path);
+static void player_model_unload( struct player_model *board );
+
+static void render_board( camera *cam, world_instance *world,
+                             struct player_board *board, m4x3f root,
+                             struct player_board_pose *pose,
+                             enum board_shader shader );
+
+static void render_playermodel( camera *cam, world_instance *world,
+                                   int depth_compare,
+                                   struct player_model *model,
+                                   struct skeleton *skeleton,
+                                   m4x3f *final_mtx );
+static void apply_full_skeleton_pose( struct skeleton *sk, player_pose *pose,
+                                      m4x3f *final_mtx );
+static void lerp_player_pose( player_pose *pose0, player_pose *pose1, f32 t,
+                              player_pose *posed );
+
 #endif /* PLAYER_RENDER_H */