5 #include "player_common.h"
8 k_player_subsystem_walk
= 0,
9 k_player_subsystem_skate
= 1,
10 k_player_subsystem_dead
= 2,
11 k_player_subsystem_drive
= 3,
12 k_player_subsystem_max
,
13 k_player_subsystem_invalid
= 255
16 struct player_cam_controller
{
18 k_cam_firstperson
= 1,
22 f32 camera_type_blend
;
24 v3f fpv_offset
, /* expressed relative to rigidbody */
27 fpv_viewpoint
, /* expressed relative to neck bone inverse final*/
35 struct player_subsystem_interface
{
36 void(*system_register
)(void);
38 void(*reset
)( ent_spawn
*rp
);
39 void(*pre_update
)(void);
41 void(*post_update
)(void);
44 void(*pose
)( void *animator
, player_pose
*pose
);
45 void(*post_animate
)(void);
53 #include "player_ragdoll.h"
54 #include "player_render.h"
55 #include "player_model.h"
56 #include "player_walk.h"
57 #include "player_skate.h"
58 #include "player_dead.h"
59 #include "player_drive.h"
60 #include "player_replay.h"
62 #define PLAYER_REWIND_FRAMES 60*4
63 #define RESET_MAX_TIME 45.0
65 static i32 k_cinema_fixed
= 0;
66 static f32 k_cinema
= 0.0f
;
67 static i32 k_invert_y
= 0;
70 /* transform definition */
75 m3x3f basis
, invbasis
, basis_gate
;
76 world_instance
*viewable_world
;
80 * ---------------------------
83 struct player_cam_controller cam_control
;
86 float cam_velocity_influence
,
87 cam_velocity_coefficient
,
88 cam_velocity_constant
,
89 cam_velocity_coefficient_smooth
,
90 cam_velocity_constant_smooth
,
91 cam_velocity_influence_smooth
;
93 v3f cam_land_punch
, cam_land_punch_v
;
94 ent_gate
*gate_waiting
;
100 * --------------------------------------------------
103 struct player_avatar
*playeravatar
;
104 struct player_ragdoll ragdoll
;
105 struct player_model fallback_model
;
107 u16 board_view_slot
, playermodel_view_slot
;
110 player_pose holdout_pose
;
117 * -------------------------------------------------
120 enum player_subsystem subsystem
; /* .. prev */
122 static localplayer
= {
128 .to_world
= M4X3_IDENTITY
,
129 .to_local
= M4X3_IDENTITY
133 struct player_subsystem_interface
static *player_subsystems
[] = {
134 [k_player_subsystem_walk
] = &player_subsystem_walk
,
135 [k_player_subsystem_dead
] = &player_subsystem_dead
,
136 [k_player_subsystem_drive
] = &player_subsystem_drive
,
137 [k_player_subsystem_skate
] = &player_subsystem_skate
142 * ---------------------------------------------------------
145 static void player__debugtext( int size
, const char *fmt
, ... );
146 static void player__use_avatar( struct player_avatar
*av
);
147 static void player__use_mesh( glmesh
*mesh
);
148 static void player__use_texture( vg_tex2d
*tex
);
149 static void player__use_model( u16 reg_id
);
151 static void player__bind(void);
152 static void player__pre_update(void);
153 static void player__update(void);
154 static void player__post_update(void);
156 static void player__pass_gate( ent_gate
*gate
);
157 static void player__im_gui(void);
158 static void player__setpos( v3f pos
);
159 static void player__spawn( ent_spawn
*rp
);
160 static void player__kill(void);
161 static void player__begin_holdout(void);
163 static int localplayer_cmd_respawn( int argc
, const char *argv
[] );
164 static void player_apply_transport_to_cam( m4x3f transport
);
166 #endif /* PLAYER_H */