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 v3f cam_override_angles
;
50 float cam_override_fov
;
51 float cam_override_strength
;
54 float cam_velocity_influence
,
55 cam_velocity_coefficient
,
56 cam_velocity_constant
,
57 cam_velocity_coefficient_smooth
,
58 cam_velocity_constant_smooth
,
59 cam_velocity_influence_smooth
;
61 v3f cam_land_punch
, cam_land_punch_v
;
63 ent_gate
*gate_waiting
;
69 * --------------------------------------------------
72 struct player_avatar
*playeravatar
;
73 struct player_model
*playermodel
;
74 struct player_ragdoll ragdoll
;
75 //struct player_board *board;
76 struct cache_board
*board_view_slot
;
78 player_pose holdout_pose
;
83 * ----------------------------------------------------
85 int rewinding
, rewind_sound_wait
;
94 ent_gate
*rewind_gate
;
96 float rewind_total_length
, rewind_predicted_time
,
98 double rewind_start
, rewind_time
;
102 * -------------------------------------------------
105 enum player_subsystem
{
106 k_player_subsystem_walk
= 0,
107 k_player_subsystem_skate
= 1,
108 k_player_subsystem_dead
= 2,
109 k_player_subsystem_drive
= 3
114 struct player_skate _skate
;
115 struct player_walk _walk
;
116 struct player_dead _dead
;
117 struct player_drive _drive
;
123 * ---------------------------------------------------------
127 void (*_player_system_register
[])(void) =
129 player__walk_register
,
130 player__skate_register
,
136 void (*_player_bind
[])( player_instance
*player
) =
145 void (*_player_reset
[])( player_instance
*player
, ent_spawn
*rp
) =
154 void (*_player_pre_update
[])( player_instance
*player
) =
156 player__walk_pre_update
,
157 player__skate_pre_update
,
159 player__drive_pre_update
163 void( *_player_update
[])( player_instance
*player
) =
166 player__skate_update
,
172 void( *_player_post_update
[])( player_instance
*player
) =
174 player__walk_post_update
,
175 player__skate_post_update
,
177 player__drive_post_update
181 void( *_player_im_gui
[])( player_instance
*player
) =
184 player__skate_im_gui
,
190 void( *_player_animate
[])( player_instance
*player
, player_animation
*dest
) =
192 player__walk_animate
,
193 player__skate_animate
,
194 player__dead_animate
,
195 player__drive_animate
199 void( *_player_post_animate
[])( player_instance
*player
) =
201 player__walk_post_animate
,
202 player__skate_post_animate
,
203 player__dead_post_animate
,
204 player__drive_post_animate
208 void( *_player_restore
[] )( player_instance
*player
) =
210 player__walk_restore
,
211 player__skate_restore
,
216 PLAYER_API
void player__debugtext( int size
, const char *fmt
, ... );
217 PLAYER_API
void player__create( player_instance
*inst
);
218 PLAYER_API
void player__use_avatar( player_instance
*player
,
219 struct player_avatar
*av
);
220 PLAYER_API
void player__use_mesh( player_instance
*player
, glmesh
*mesh
);
221 PLAYER_API
void player__use_texture( player_instance
*player
, vg_tex2d
*tex
);
222 PLAYER_API
void player__bind( player_instance
*player
);
223 PLAYER_API
void player__pre_update( player_instance
*player
);
224 PLAYER_API
void player__update( player_instance
*player
);
225 PLAYER_API
void player__post_update( player_instance
*player
);
227 PLAYER_API
void player__pass_gate( player_instance
*player
, ent_gate
*gate
);
228 PLAYER_API
void player__im_gui( player_instance
*player
);
229 PLAYER_API
void player__spawn( player_instance
*player
, ent_spawn
*rp
);
230 PLAYER_API
void player__kill( player_instance
*player
);
232 VG_STATIC
int localplayer_cmd_respawn( int argc
, const char *argv
[] );
233 VG_STATIC
void player_apply_transport_to_cam( m4x3f transport
);
235 #endif /* PLAYER_H */