4 #include "player_ragdoll.h"
5 #include "player_render.h"
6 #include "player_model.h"
7 #include "player_common.h"
8 #include "player_walk.h"
9 #include "player_skate.h"
10 #include "player_dead.h"
11 #include "player_drive.h"
13 #define PLAYER_REWIND_FRAMES 60*4
14 #define RESET_MAX_TIME 45.0
16 struct player_instance
18 /* transform definition */
19 rigidbody rb
, rb_gate_storage
;
20 v3f angles
, angles_storage
;
23 m3x3f basis
, invbasis
, basis_gate
;
24 world_instance
*viewable_world
;
28 * ---------------------------
33 k_cam_firstperson
= 1,
37 float camera_type_blend
;
39 v3f fpv_offset
, /* expressed relative to rigidbody */
41 fpv_viewpoint
, /* expressed relative to neck bone inverse final */
49 v2f cam_override_angles
;
50 float cam_override_strength
;
52 float cam_velocity_influence
,
53 cam_velocity_coefficient
,
54 cam_velocity_constant
,
55 cam_velocity_coefficient_smooth
,
56 cam_velocity_constant_smooth
,
57 cam_velocity_influence_smooth
,
61 ent_gate
*gate_waiting
;
65 * --------------------------------
67 struct input_binding
*input_js1h
,
86 * --------------------------------------------------
90 struct player_avatar
*playeravatar
;
91 struct player_model
*playermodel
;
92 struct player_board
*playerboard
;
93 struct player_ragdoll ragdoll
;
95 player_pose holdout_pose
;
100 * ----------------------------------------------------
102 int rewinding
, rewind_sound_wait
;
111 ent_gate
*rewind_gate
;
113 float rewind_total_length
, rewind_predicted_time
,
115 double rewind_start
, rewind_time
;
119 * -------------------------------------------------
122 enum player_subsystem
{
123 k_player_subsystem_walk
= 0,
124 k_player_subsystem_skate
= 1,
125 k_player_subsystem_dead
= 2,
126 k_player_subsystem_drive
= 3
131 struct player_skate _skate
;
132 struct player_walk _walk
;
133 struct player_dead _dead
;
134 struct player_drive _drive
;
140 * ---------------------------------------------------------
144 void (*_player_system_register
[])(void) =
146 player__walk_register
,
147 player__skate_register
,
153 void (*_player_bind
[])( player_instance
*player
) =
162 void (*_player_reset
[])( player_instance
*player
, ent_spawn
*rp
) =
171 void (*_player_pre_update
[])( player_instance
*player
) =
173 player__walk_pre_update
,
174 player__skate_pre_update
,
176 player__drive_pre_update
180 void( *_player_update
[])( player_instance
*player
) =
183 player__skate_update
,
189 void( *_player_post_update
[])( player_instance
*player
) =
191 player__walk_post_update
,
192 player__skate_post_update
,
194 player__drive_post_update
198 void( *_player_im_gui
[])( player_instance
*player
) =
201 player__skate_im_gui
,
207 void( *_player_animate
[])( player_instance
*player
, player_animation
*dest
) =
209 player__walk_animate
,
210 player__skate_animate
,
211 player__dead_animate
,
212 player__drive_animate
216 void( *_player_post_animate
[])( player_instance
*player
) =
218 player__walk_post_animate
,
219 player__skate_post_animate
,
220 player__dead_post_animate
,
221 player__drive_post_animate
225 void( *_player_restore
[] )( player_instance
*player
) =
227 player__walk_restore
,
228 player__skate_restore
,
233 PLAYER_API
void player__debugtext( int size
, const char *fmt
, ... );
234 PLAYER_API
void player__create( player_instance
*inst
);
235 PLAYER_API
void player__use_avatar( player_instance
*player
,
236 struct player_avatar
*av
);
237 PLAYER_API
void player__use_mesh( player_instance
*player
, glmesh
*mesh
);
238 PLAYER_API
void player__use_texture( player_instance
*player
, vg_tex2d
*tex
);
239 PLAYER_API
void player__bind( player_instance
*player
);
240 PLAYER_API
void player__pre_update( player_instance
*player
);
241 PLAYER_API
void player__update( player_instance
*player
);
242 PLAYER_API
void player__post_update( player_instance
*player
);
244 PLAYER_API
void player__pass_gate( player_instance
*player
, ent_gate
*gate
);
245 PLAYER_API
void player__im_gui( player_instance
*player
);
246 PLAYER_API
void player__spawn( player_instance
*player
, ent_spawn
*rp
);
247 PLAYER_API
void player__kill( player_instance
*player
);
252 #include "player_common.c"
253 #include "player_walk.c"
254 #include "player_skate.c"
255 #include "player_dead.c"
256 #include "player_drive.c"
257 #include "player_render.c"
258 #include "player_ragdoll.c"
260 #endif /* PLAYER_H */