3 #include "player_api.h"
4 #include "vg/vg_rigidbody.h"
6 #define PLAYER_JUMP_EPSILON 0.1 /* 100ms jump allowance */
12 struct player_walk_state
{
18 float drop_in_start_angle
,
23 k_walk_activity_ground
,
25 k_walk_activity_sit_up
,
28 k_walk_activity_inone
,
29 k_walk_activity_ipopoff
,
31 k_walk_activity_odrop_in
,
32 k_walk_activity_oregular
,
51 enum mdl_surface_prop surface
;
52 struct skeleton_anim
*anim_walk
, *anim_run
, *anim_idle
, *anim_jump
,
53 *anim_jump_to_air
, *anim_drop_in
, *anim_intro
,
54 *anim_sit
, *anim_popoff
;
56 struct player_walk_animator
{
63 f32 walk_timer
, yaw
, pitch
, board_yaw
;
65 enum walk_activity activity
;
71 extern struct player_subsystem_interface player_subsystem_walk
;
73 enum player_walk_soundeffect
{
74 k_player_walk_soundeffect_splash
83 k_walk_air_accel
= 7.0f
,
84 k_walk_friction
= 6.0f
,
85 k_walk_step_height
= 0.2f
,
87 k_sit_yaw_limit
= VG_PIf
/1.7f
,
88 k_sit_pitch_limit
= VG_PIf
/4.0f
;
90 static void player__walk_register(void){
91 VG_VAR_F32( k_walkspeed
, flags
=VG_VAR_CHEAT
);
92 VG_VAR_F32( k_runspeed
, flags
=VG_VAR_CHEAT
);
93 VG_VAR_F32( k_stopspeed
, flags
=VG_VAR_CHEAT
);
94 VG_VAR_F32( k_airspeed
, flags
=VG_VAR_CHEAT
);
95 VG_VAR_F32( k_walk_friction
, flags
=VG_VAR_CHEAT
);
96 VG_VAR_F32( k_walk_air_accel
, flags
=VG_VAR_CHEAT
);
97 VG_VAR_F32( k_walk_accel
, flags
=VG_VAR_CHEAT
);
100 void player__walk_pre_update (void);
101 void player__walk_update (void);
102 void player__walk_post_update (void);
103 void player__walk_animate (void);
104 void player__walk_pose (void *animator
, player_pose
*pose
);
105 void player__walk_post_animate(void);
106 void player__walk_im_gui (void);
107 void player__walk_bind (void);
108 void player__walk_reset (void);
109 void player__walk_restore (void);
110 void player__walk_animator_exchange( bitpack_ctx
*ctx
, void *data
);
111 void player__walk_transition( bool grounded
, f32 board_yaw
);