7 k_player_subsystem_walk
= 0,
8 k_player_subsystem_skate
= 1,
9 k_player_subsystem_dead
= 2,
10 k_player_subsystem_drive
= 3
13 struct player_cam_controller
{
15 k_cam_firstperson
= 1,
19 f32 camera_type_blend
;
21 v3f fpv_offset
, /* expressed relative to rigidbody */
24 fpv_viewpoint
, /* expressed relative to neck bone inverse final*/
32 #include "player_ragdoll.h"
33 #include "player_render.h"
34 #include "player_model.h"
35 #include "player_common.h"
36 #include "player_walk.h"
37 #include "player_skate.h"
38 #include "player_dead.h"
39 #include "player_drive.h"
40 #include "player_replay.h"
42 #define PLAYER_REWIND_FRAMES 60*4
43 #define RESET_MAX_TIME 45.0
45 static i32 k_cinema_fixed
= 0;
46 static f32 k_cinema
= 0.0f
;
47 static i32 k_invert_y
= 0;
49 struct player_instance
{
50 /* transform definition */
55 m3x3f basis
, invbasis
, basis_gate
;
56 world_instance
*viewable_world
;
60 * ---------------------------
63 struct player_cam_controller cam_control
;
66 float cam_velocity_influence
,
67 cam_velocity_coefficient
,
68 cam_velocity_constant
,
69 cam_velocity_coefficient_smooth
,
70 cam_velocity_constant_smooth
,
71 cam_velocity_influence_smooth
;
73 v3f cam_land_punch
, cam_land_punch_v
;
74 ent_gate
*gate_waiting
;
80 * --------------------------------------------------
83 struct player_avatar
*playeravatar
;
84 struct player_ragdoll ragdoll
;
85 struct player_model fallback_model
;
87 u16 board_view_slot
, playermodel_view_slot
;
90 player_pose holdout_pose
;
95 * -------------------------------------------------
98 enum player_subsystem subsystem
; /* .. prev */
100 struct player_skate _skate
;
101 struct player_walk _walk
;
102 struct player_dead _dead
;
103 struct player_drive _drive
;
109 * ---------------------------------------------------------
113 void (*_player_system_register
[])(void) = {
114 player__walk_register
,
115 player__skate_register
,
121 void (*_player_bind
[])( player_instance
*player
) = {
129 void (*_player_reset
[])( player_instance
*player
, ent_spawn
*rp
) = {
137 void (*_player_pre_update
[])( player_instance
*player
) = {
138 player__walk_pre_update
,
139 player__skate_pre_update
,
141 player__drive_pre_update
145 void( *_player_update
[])( player_instance
*player
) = {
147 player__skate_update
,
153 void( *_player_post_update
[])( player_instance
*player
) = {
154 player__walk_post_update
,
155 player__skate_post_update
,
157 player__drive_post_update
161 void( *_player_im_gui
[])( player_instance
*player
) = {
163 player__skate_im_gui
,
169 void( *_player_animate
[])( player_instance
*player
) = {
170 player__walk_animate
,
171 player__skate_animate
,
172 player__dead_animate
,
173 player__drive_animate
177 void( *_player_pose
[] )( player_instance
*player
) = {
185 void( *_player_post_animate
[])( player_instance
*player
) = {
186 player__walk_post_animate
,
187 player__skate_post_animate
,
188 player__dead_post_animate
,
189 player__drive_post_animate
192 PLAYER_API
void player__debugtext( int size
, const char *fmt
, ... );
193 PLAYER_API
void player__create( player_instance
*inst
);
194 PLAYER_API
void player__use_avatar( player_instance
*player
,
195 struct player_avatar
*av
);
196 PLAYER_API
void player__use_mesh( player_instance
*player
, glmesh
*mesh
);
197 PLAYER_API
void player__use_texture( player_instance
*player
, vg_tex2d
*tex
);
198 PLAYER_API
void player__use_model( player_instance
*player
, u16 reg_id
);
200 PLAYER_API
void player__bind( player_instance
*player
);
201 PLAYER_API
void player__pre_update( player_instance
*player
);
202 PLAYER_API
void player__update( player_instance
*player
);
203 PLAYER_API
void player__post_update( player_instance
*player
);
205 PLAYER_API
void player__pass_gate( player_instance
*player
, ent_gate
*gate
);
206 PLAYER_API
void player__im_gui( player_instance
*player
);
207 PLAYER_API
void player__setpos( player_instance
*player
, v3f pos
);
208 PLAYER_API
void player__spawn( player_instance
*player
, ent_spawn
*rp
);
209 PLAYER_API
void player__kill( player_instance
*player
);
210 PLAYER_API
void player__begin_holdout( player_instance
*player
);
212 VG_STATIC
int localplayer_cmd_respawn( int argc
, const char *argv
[] );
213 VG_STATIC
void player_apply_transport_to_cam( m4x3f transport
);
215 #endif /* PLAYER_H */