VG_STATIC void player__animate( player_instance *player ){
if( _player_animate[ player->subsystem ] &&
- _player_pose[ player->subsystem ] ){
+ _player_pose[ player->subsystem ] ){
_player_animate[ player->subsystem ]( player );
_player_pose[ player->subsystem ]( player, &player->pose );
- player_pose *pose = &player->pose;
struct skeleton *sk = &player->playeravatar->sk;
if( player->holdout_time > 0.0f ){
+ player_pose *pose = &player->pose;
skeleton_lerp_pose( sk,
pose->keyframes, player->holdout_pose.keyframes,
player->holdout_time, pose->keyframes );
int walk_phase = 0;
- if( vg_fractf(w->walk_timer) > 0.5f )
+ if( vg_fractf(w->state.walk_timer) > 0.5f )
walk_phase = 1;
else
walk_phase = 0;
- if( (w->step_phase != walk_phase) &&
+ if( (w->state.step_phase != walk_phase) &&
(w->state.activity == k_walk_activity_ground ) )
{
audio_lock();
audio_unlock();
}
- w->step_phase = walk_phase;
+ w->state.step_phase = walk_phase;
}
VG_STATIC void player__walk_animate( player_instance *player ){
run_norm = 30.0f/(float)w->anim_run->length,
walk_adv = vg_lerpf( walk_norm, run_norm, w->move_speed );
- w->walk_timer += walk_adv * vg.time_delta;
- }
- else{
- w->walk_timer = 0.0f;
+ w->state.walk_timer += walk_adv * vg.time_delta;
}
+ else
+ w->state.walk_timer = 0.0f;
+ animator->walk_timer = w->state.walk_timer;
if( !player->immobile )
rb_extrapolate( &player->rb, animator->root_co, animator->root_q );
v3_copy( animator->root_co, pose->root_co );
v4_copy( animator->root_q, pose->root_q );
pose->board.lean = 0.0f;
+ pose->type = k_player_pose_type_ik;
float walk_norm = (float)w->anim_walk->length/30.0f,
run_norm = (float)w->anim_run->length/30.0f,
- t = w->walk_timer,
+ t = animator->walk_timer,
l = vg_clampf( animator->run*15.0f, 0.0f, 1.0f ),
idle_walk = vg_clampf( (animator->run-0.1f)/(1.0f-0.1f), 0.0f, 1.0f );
int jump_queued;
f64 jump_input_time;
+
+ f32 walk_timer;
+ int step_phase;
}
state;
- f32 move_speed,
- walk_timer;
-
- int step_phase;
+ f32 move_speed;
enum mdl_surface_prop surface;
struct skeleton_anim *anim_walk, *anim_run, *anim_idle, *anim_jump,
run,
walk;
+ f32 walk_timer;
+
v3f foot_anchor;
enum walk_outro outro_type;
f32 outro_t,
}
VG_STATIC void render_main_game(void){
- player__animate( &localplayer );
if( skaterift.activity == k_skaterift_replay ){
player__animate_from_replay( &localplayer, &skaterift.replay );
}
- else
+ else{
+ player__animate( &localplayer );
skaterift_record_frame( &skaterift.replay, 0 );
+ }
player__pre_render( &localplayer );
skaterift_composite_maincamera();
it up with the oblique rendering inside the
portals */
- //world_render_challenges( localplayer.viewable_world );
-
/* continue with variable rate */
render_scene_gate_subview();