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
14 struct player_cam_controller
{
16 k_cam_firstperson
= 1,
20 f32 camera_type_blend
;
22 v3f fpv_offset
, /* expressed relative to rigidbody */
25 fpv_viewpoint
, /* expressed relative to neck bone inverse final*/
33 struct player_subsystem_interface
{
34 void(*system_register
)(void);
36 void(*reset
)( ent_spawn
*rp
);
37 void(*pre_update
)(void);
39 void(*post_update
)(void);
42 void(*pose
)( void *animator
, player_pose
*pose
);
43 void(*post_animate
)(void);
49 #include "player_ragdoll.h"
50 #include "player_render.h"
51 #include "player_model.h"
52 #include "player_walk.h"
53 #include "player_skate.h"
54 #include "player_dead.h"
55 #include "player_drive.h"
56 #include "player_replay.h"
58 #define PLAYER_REWIND_FRAMES 60*4
59 #define RESET_MAX_TIME 45.0
61 static i32 k_cinema_fixed
= 0;
62 static f32 k_cinema
= 0.0f
;
63 static i32 k_invert_y
= 0;
66 /* transform definition */
71 m3x3f basis
, invbasis
, basis_gate
;
72 world_instance
*viewable_world
;
76 * ---------------------------
79 struct player_cam_controller cam_control
;
82 float cam_velocity_influence
,
83 cam_velocity_coefficient
,
84 cam_velocity_constant
,
85 cam_velocity_coefficient_smooth
,
86 cam_velocity_constant_smooth
,
87 cam_velocity_influence_smooth
;
89 v3f cam_land_punch
, cam_land_punch_v
;
90 ent_gate
*gate_waiting
;
96 * --------------------------------------------------
99 struct player_avatar
*playeravatar
;
100 struct player_ragdoll ragdoll
;
101 struct player_model fallback_model
;
103 u16 board_view_slot
, playermodel_view_slot
;
106 player_pose holdout_pose
;
111 * -------------------------------------------------
114 enum player_subsystem subsystem
; /* .. prev */
116 static localplayer
= {
122 .to_world
= M4X3_IDENTITY
,
123 .to_local
= M4X3_IDENTITY
127 struct player_subsystem_interface
static *player_subsystems
[] = {
128 [k_player_subsystem_walk
] = &player_subsystem_walk
,
129 [k_player_subsystem_dead
] = &player_subsystem_dead
,
130 [k_player_subsystem_drive
] = &player_subsystem_drive
,
131 [k_player_subsystem_skate
] = &player_subsystem_skate
136 * ---------------------------------------------------------
139 static void player__debugtext( int size
, const char *fmt
, ... );
140 static void player__use_avatar( struct player_avatar
*av
);
141 static void player__use_mesh( glmesh
*mesh
);
142 static void player__use_texture( vg_tex2d
*tex
);
143 static void player__use_model( u16 reg_id
);
145 static void player__bind(void);
146 static void player__pre_update(void);
147 static void player__update(void);
148 static void player__post_update(void);
150 static void player__pass_gate( ent_gate
*gate
);
151 static void player__im_gui(void);
152 static void player__setpos( v3f pos
);
153 static void player__spawn( ent_spawn
*rp
);
154 static void player__kill(void);
155 static void player__begin_holdout(void);
157 static int localplayer_cmd_respawn( int argc
, const char *argv
[] );
158 static void player_apply_transport_to_cam( m4x3f transport
);
160 #endif /* PLAYER_H */