4 #include "player_api.h"
6 #include "player_common.h"
7 #include "player_walk.h"
8 #include "player_skate.h"
9 #include "player_dead.h"
10 #include "player_drive.h"
12 #define PLAYER_REWIND_FRAMES 60*4
14 struct player_instance
16 /* transform definition */
17 rigidbody rb
, rb_gate_storage
;
18 v3f angles
, angles_storage
;
21 m3x3f basis
, invbasis
, basis_gate
;
22 world_instance
*viewable_world
;
26 * ---------------------------
31 k_cam_firstperson
= 1,
35 float camera_type_blend
;
37 v3f fpv_offset
, /* expressed relative to rigidbody */
39 fpv_viewpoint
, /* expressed relative to neck bone inverse final */
47 v2f cam_override_angles
;
48 float cam_override_strength
;
50 float cam_velocity_influence
,
51 cam_velocity_coefficient
,
52 cam_velocity_constant
,
53 cam_velocity_coefficient_smooth
,
54 cam_velocity_constant_smooth
,
55 cam_velocity_influence_smooth
,
59 ent_gate
*gate_waiting
;
63 * --------------------------------
65 struct input_binding
*input_js1h
,
84 * --------------------------------------------------
87 struct player_avatar
*playeravatar
;
89 struct player_ragdoll ragdoll
;
92 player_pose holdout_pose
;
97 * ----------------------------------------------------
99 int rewinding
, rewind_sound_wait
;
108 ent_gate
*rewind_gate
;
110 float rewind_total_length
, rewind_predicted_time
,
112 double rewind_start
, rewind_time
;
116 * -------------------------------------------------
119 enum player_subsystem
{
120 k_player_subsystem_walk
= 0,
121 k_player_subsystem_skate
= 1,
122 k_player_subsystem_dead
= 2,
123 k_player_subsystem_drive
= 3
128 struct player_skate _skate
;
129 struct player_walk _walk
;
130 struct player_dead _dead
;
131 struct player_drive _drive
;
136 * ---------------------------------------------------------
140 void (*_player_bind
[])( player_instance
*player
) =
149 void (*_player_reset
[])( player_instance
*player
, ent_spawn
*rp
) =
158 void (*_player_pre_update
[])( player_instance
*player
) =
160 player__walk_pre_update
,
161 player__skate_pre_update
,
163 player__drive_pre_update
167 void( *_player_update
[])( player_instance
*player
) =
170 player__skate_update
,
176 void( *_player_post_update
[])( player_instance
*player
) =
178 player__walk_post_update
,
179 player__skate_post_update
,
181 player__drive_post_update
185 void( *_player_im_gui
[])( player_instance
*player
) =
188 player__skate_im_gui
,
194 void( *_player_animate
[])( player_instance
*player
, player_animation
*dest
) =
196 player__walk_animate
,
197 player__skate_animate
,
198 player__dead_animate
,
199 player__drive_animate
203 void( *_player_post_animate
[])( player_instance
*player
) =
205 player__walk_post_animate
,
206 player__skate_post_animate
,
207 player__dead_post_animate
,
208 player__drive_post_animate
212 void( *_player_restore
[] )( player_instance
*player
) =
214 player__walk_restore
,
215 player__skate_restore
,
223 #include "player_common.c"
224 #include "player_walk.c"
225 #include "player_skate.c"
226 #include "player_dead.c"
227 #include "player_drive.c"
229 #endif /* PLAYER_H */