stepping
[carveJwlIkooP6JGAAIwe30JlM.git] / player.h
index 137a1ad056896fb33289b2f24a4aa2f408847bf4..8a0b17d28552f3992c99874bd746d4987f59da95 100644 (file)
--- a/player.h
+++ b/player.h
@@ -6,7 +6,7 @@
 #include "player_common.h"
 #include "player_walk.h"
 #include "player_skate.h"
-//#include "player_dead.h"
+#include "player_dead.h"
 
 struct player_instance
 {
@@ -14,6 +14,10 @@ struct player_instance
    rigidbody rb;
    v3f angles;
 
+   v4f   qbasis;
+   m3x3f basis, invbasis, basis_gate;
+   world_instance *viewable_world;
+
    /*
     * Camera management
     * ---------------------------
@@ -47,7 +51,7 @@ struct player_instance
          cam_land_punch,
          cam_land_punch_v;
 
-   teleport_gate *gate_waiting;
+   ent_gate *gate_waiting;
 
    /*
     * Input 
@@ -59,6 +63,9 @@ struct player_instance
                         *input_js2v,
                         *input_jump,
                         *input_push,
+                        *input_trick0,
+                        *input_trick1,
+                        *input_trick2,
                         *input_walk,
                         *input_walkh,
                         *input_walkv,
@@ -95,7 +102,7 @@ struct player_instance
 
    struct player_skate  _skate;
    struct player_walk   _walk;
-   //struct player_dead   _dead;
+   struct player_dead   _dead;
 };
 
 /*
@@ -112,9 +119,9 @@ void (*_player_bind[])( player_instance *player ) =
 };
 
 VG_STATIC
-void (*_player_reset[])( player_instance *player, struct respawn_point *rp ) =
+void (*_player_reset[])( player_instance *player, ent_spawn *rp ) =
 {
-   NULL,
+   player__walk_reset,
    player__skate_reset,
    NULL
 };
@@ -132,7 +139,7 @@ void( *_player_update[])( player_instance *player ) =
 {
    player__walk_update,
    player__skate_update,
-   NULL
+   player__dead_update,
 };
 
 VG_STATIC 
@@ -156,7 +163,7 @@ void( *_player_animate[])( player_instance *player, player_animation *dest ) =
 {
    player__walk_animate,
    player__skate_animate,
-   NULL
+   player__dead_animate
 };
 
 VG_STATIC
@@ -164,7 +171,7 @@ void( *_player_post_animate[])( player_instance *player ) =
 {
    player__walk_post_animate,
    player__skate_post_animate,
-   NULL
+   player__dead_post_animate
 };
 
 /* implementation */
@@ -173,7 +180,7 @@ void( *_player_post_animate[])( player_instance *player ) =
 #include "player_common.c"
 #include "player_walk.c"
 #include "player_skate.c"
-//#include "player_dead.c"
+#include "player_dead.c"
 
 #endif /* PLAYER_H */
 
@@ -394,68 +401,6 @@ VG_STATIC void reset_player_poll( int argc, char const *argv[] );
 
 VG_STATIC void player_init(void)                                         /* 1 */
 {
-#if 0
-   player.input_js1h = vg_create_named_input( "steer-h", k_input_type_axis );
-   player.input_js1v = vg_create_named_input( "steer-v", k_input_type_axis );
-   player.input_grab = vg_create_named_input( "grab", k_input_type_axis_norm );
-   player.input_js2h = vg_create_named_input( "grab-h", k_input_type_axis );
-   player.input_js2v = vg_create_named_input( "grab-v", k_input_type_axis );
-   player.input_jump = vg_create_named_input( "jump", k_input_type_button );
-   player.input_push = vg_create_named_input( "push", k_input_type_button );
-   player.input_walk = vg_create_named_input( "walk", k_input_type_button );
-
-   player.input_walkh = vg_create_named_input( "walk-h", 
-                                               k_input_type_axis );
-   player.input_walkv = vg_create_named_input( "walk-v", 
-                                               k_input_type_axis );
-
-
-   player.input_switch_mode = vg_create_named_input( "switch-mode",
-                                                     k_input_type_button );
-   player.input_reset = vg_create_named_input( "reset", k_input_type_button );
-
-   const char *default_cfg[] = 
-   {
-      "bind  steer-h gp-ls-h",
-      "bind -steer-h a",
-      "bind +steer-h d",
-
-      "bind  steer-v gp-ls-v",
-      "bind -steer-v w",
-      "bind +steer-v s",
-
-      "bind  grab gp-rt",
-      "bind +grab shift",
-      "bind  grab-h gp-rs-h",
-      "bind  grab-v gp-rs-v",
-
-      "bind jump space",
-      "bind jump gp-a",
-
-      "bind push gp-b",
-      "bind push w",
-
-      "bind walk shift",
-      "bind walk gp-ls",
-      
-      "bind  walk-h  gp-ls-h",
-      "bind  walk-v -gp-ls-v",
-      "bind +walk-h d",
-      "bind -walk-h a",
-      "bind +walk-v w",
-      "bind -walk-v s",
-
-      "bind reset gp-lb",
-      "bind reset r",
-
-      "bind switch-mode gp-y",
-      "bind switch-mode e",
-   };
-
-   for( int i=0; i<vg_list_size(default_cfg); i++ )
-      vg_execute_console_input(default_cfg[i]);
-#endif
-
    rb_init( &player.rb );
 
    VG_VAR_F32( k_walkspeed );
@@ -463,14 +408,12 @@ VG_STATIC void player_init(void)                                         /* 1 */
    VG_VAR_F32( k_airspeed );
    VG_VAR_F32( k_walk_friction );
    VG_VAR_F32( k_walk_air_accel );
-   VG_VAR_F32( k_runspeed );
    VG_VAR_F32( k_walk_accel );
 
    VG_VAR_I32( freecam );
    VG_VAR_I32( cl_thirdperson );
    VG_VAR_F32_PERSISTENT( fc_speed );
 
-   /* TODO: NOT PERSISTENT */
    VG_VAR_F32( k_ragdoll_limit_scale );
    VG_VAR_I32( k_ragdoll_div );
    VG_VAR_I32( k_ragdoll_debug_collider );