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
13 #define RESET_MAX_TIME 45.0
15 struct player_instance
17 /* transform definition */
18 rigidbody rb
, rb_gate_storage
;
19 v3f angles
, angles_storage
;
22 m3x3f basis
, invbasis
, basis_gate
;
23 world_instance
*viewable_world
;
27 * ---------------------------
32 k_cam_firstperson
= 1,
36 float camera_type_blend
;
38 v3f fpv_offset
, /* expressed relative to rigidbody */
40 fpv_viewpoint
, /* expressed relative to neck bone inverse final */
48 v2f cam_override_angles
;
49 float cam_override_strength
;
51 float cam_velocity_influence
,
52 cam_velocity_coefficient
,
53 cam_velocity_constant
,
54 cam_velocity_coefficient_smooth
,
55 cam_velocity_constant_smooth
,
56 cam_velocity_influence_smooth
,
60 ent_gate
*gate_waiting
;
64 * --------------------------------
66 struct input_binding
*input_js1h
,
85 * --------------------------------------------------
88 struct player_avatar
*playeravatar
;
90 struct player_ragdoll ragdoll
;
93 player_pose holdout_pose
;
98 * ----------------------------------------------------
100 int rewinding
, rewind_sound_wait
;
109 ent_gate
*rewind_gate
;
111 float rewind_total_length
, rewind_predicted_time
,
113 double rewind_start
, rewind_time
;
117 * -------------------------------------------------
120 enum player_subsystem
{
121 k_player_subsystem_walk
= 0,
122 k_player_subsystem_skate
= 1,
123 k_player_subsystem_dead
= 2,
124 k_player_subsystem_drive
= 3
129 struct player_skate _skate
;
130 struct player_walk _walk
;
131 struct player_dead _dead
;
132 struct player_drive _drive
;
138 * ---------------------------------------------------------
142 void (*_player_system_register
[])(void) =
144 player__walk_register
,
145 player__skate_register
,
151 void (*_player_bind
[])( player_instance
*player
) =
160 void (*_player_reset
[])( player_instance
*player
, ent_spawn
*rp
) =
169 void (*_player_pre_update
[])( player_instance
*player
) =
171 player__walk_pre_update
,
172 player__skate_pre_update
,
174 player__drive_pre_update
178 void( *_player_update
[])( player_instance
*player
) =
181 player__skate_update
,
187 void( *_player_post_update
[])( player_instance
*player
) =
189 player__walk_post_update
,
190 player__skate_post_update
,
192 player__drive_post_update
196 void( *_player_im_gui
[])( player_instance
*player
) =
199 player__skate_im_gui
,
205 void( *_player_animate
[])( player_instance
*player
, player_animation
*dest
) =
207 player__walk_animate
,
208 player__skate_animate
,
209 player__dead_animate
,
210 player__drive_animate
214 void( *_player_post_animate
[])( player_instance
*player
) =
216 player__walk_post_animate
,
217 player__skate_post_animate
,
218 player__dead_post_animate
,
219 player__drive_post_animate
223 void( *_player_restore
[] )( player_instance
*player
) =
225 player__walk_restore
,
226 player__skate_restore
,
234 #include "player_common.c"
235 #include "player_walk.c"
236 #include "player_skate.c"
237 #include "player_dead.c"
238 #include "player_drive.c"
240 #endif /* PLAYER_H */