#include "player_skate.h"
#include "player_dead.h"
+#define PLAYER_REWIND_FRAMES 60*4
+
struct player_instance
{
/* transform definition */
- rigidbody rb;
- v3f angles;
+ rigidbody rb, rb_gate_storage;
+ v3f angles, angles_storage;
v4f qbasis;
m3x3f basis, invbasis, basis_gate;
* Camera management
* ---------------------------
*/
- camera cam; /* output final camera */
+ camera cam;
enum camera_mode
{
- k_cam_firstperson = 0,
- k_cam_thirdperson = 1
+ k_cam_firstperson = 1,
+ k_cam_thirdperson = 0
}
camera_mode;
float camera_type_blend;
-
v3f fpv_offset, /* expressed relative to rigidbody */
tpv_offset,
fpv_viewpoint, /* expressed relative to neck bone inverse final */
tpv_lpf,
cam_velocity_smooth;
+ v3f cam_override_pos;
+ v2f cam_override_angles;
+ float cam_override_strength;
+
float cam_velocity_influence,
cam_velocity_coefficient,
cam_velocity_constant,
player_pose holdout_pose;
float holdout_time;
+ /*
+ * Rewind
+ * ----------------------------------------------------
+ */
+ int rewinding, rewind_sound_wait;
+
+ struct rewind_frame{
+ v3f pos;
+ v3f ang;
+ }
+ *rewind_buffer;
+ u32 rewind_length;
+ float rewind_accum;
+ ent_gate *rewind_gate;
+
+ float rewind_total_length, rewind_predicted_time,
+ dist_accum;
+ double rewind_start, rewind_time;
+
/*
* Subsystems
* -------------------------------------------------
k_player_subsystem_skate = 1,
k_player_subsystem_dead = 2
}
- subsystem;
+ subsystem,
+ subsystem_gate;
struct player_skate _skate;
struct player_walk _walk;
player__dead_post_animate
};
+VG_STATIC
+void( *_player_restore[] )( player_instance *player ) =
+{
+ player__walk_restore,
+ player__skate_restore,
+ NULL
+};
+
/* implementation */
#include "player.c"