X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_walk.c;h=b37095da28ded733db41f629dfad1a3d2a61cf45;hb=ca35eceae3abfcfb9ba266d6ea8e664bc06b0a3e;hp=dbf0d026f3487efa251c19b8c2fa11123fea0690;hpb=cbeec2e44e93ab43ccde54c2dd9cd02f559ebef8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_walk.c b/player_walk.c index dbf0d02..b37095d 100644 --- a/player_walk.c +++ b/player_walk.c @@ -88,7 +88,7 @@ VG_STATIC void player_walk_drop_in_to_skate( player_instance *player ) v3_muladds( player->rb.co, player->rb.to_world[1], 1.0f, s->state.cog ); v3_copy( init_velocity, s->state.cog_v ); v3_copy( init_velocity, player->rb.v ); - v3_copy( init_velocity, player->cam_velocity_smooth ); + v3_copy( init_velocity, player->cam_control.cam_velocity_smooth ); v3_copy( (v3f){1.0f,0.0f,0.0f}, s->state.trick_euler ); } @@ -147,7 +147,7 @@ VG_STATIC int player_walk_scan_for_drop_in( player_instance *player ) if( ray_world( world, pos, ray_dir, ray ) ) { vg_line( pos, ray->pos, VG__RED ); - vg_line_pt3( ray->pos, 0.025f, VG__BLACK ); + vg_line_point( ray->pos, 0.025f, VG__BLACK ); sample_count ++; } @@ -225,7 +225,7 @@ VG_STATIC int player_walk_scan_for_drop_in( player_instance *player ) if( ray_world( world, va, v0, &ray ) ) { vg_line( va, vb, VG__RED ); - vg_line_pt3( ray.pos, 0.1f, VG__RED ); + vg_line_point( ray.pos, 0.1f, VG__RED ); vg_error( "invalidated\n" ); return 0; } @@ -234,7 +234,7 @@ VG_STATIC int player_walk_scan_for_drop_in( player_instance *player ) if( ray_world( world, vb, v0, &ray ) ) { vg_line( va, vb, VG__RED ); - vg_line_pt3( ray.pos, 0.1f, VG__RED ); + vg_line_point( ray.pos, 0.1f, VG__RED ); vg_error( "invalidated\n" ); return 0; } @@ -285,7 +285,7 @@ VG_STATIC void player__walk_pre_update( player_instance *player ) } else{ struct player_board *board = - addon_cache_item_if_loaded( k_workshop_file_type_board, + addon_cache_item_if_loaded( k_addon_type_board, player->board_view_slot ); if( !board ) return; @@ -392,7 +392,7 @@ VG_STATIC void player__walk_update( player_instance *player ) m3x3_copy( player->rb.to_world, mtx ); v3_add( player->rb.co, player->basis[1], mtx[3] ); - debug_capsule( mtx, w->collider.radius, w->collider.height, VG__WHITE ); + vg_line_capsule( mtx, w->collider.radius, w->collider.height, VG__WHITE ); rb_ct manifold[64]; int len; @@ -457,7 +457,7 @@ VG_STATIC void player__walk_update( player_instance *player ) v3_normalize( surface_avg ); v3f tx, ty; - rb_tangent_basis( surface_avg, tx, ty ); + v3_tangent_basis( surface_avg, tx, ty ); if( v2_length2(steer) > 0.001f ){ /* clip movement to the surface */ @@ -559,7 +559,7 @@ VG_STATIC void player__walk_update( player_instance *player ) v3_muladds( player->rb.co, player->rb.v, k_rb_delta, player->rb.co ); v3_add( player->rb.co, player->basis[1], mtx[3] ); - debug_capsule( mtx, w->collider.radius, w->collider.height, VG__GREEN ); + vg_line_capsule( mtx, w->collider.radius, w->collider.height, VG__GREEN ); /* * CCD routine @@ -588,7 +588,7 @@ VG_STATIC void player__walk_update( player_instance *player ) rb_update_transform( &player->rb ); v3_add( player->rb.co, player->basis[1], mtx[3] ); - debug_capsule( mtx, w->collider.radius, w->collider.height, VG__RED ); + vg_line_capsule( mtx, w->collider.radius, w->collider.height, VG__RED ); } } @@ -626,7 +626,7 @@ VG_STATIC void player__walk_post_update( player_instance *player ) float substep = vg.time_fixed_extrapolate; v3_muladds( mtx[3], player->rb.v, k_rb_delta*substep, mtx[3] ); - debug_capsule( mtx, w->collider.radius, w->collider.height, VG__YELOW ); + vg_line_capsule( mtx, w->collider.radius, w->collider.height, VG__YELOW ); /* Calculate header */ @@ -642,7 +642,7 @@ VG_STATIC void player__walk_post_update( player_instance *player ) q_normalize( player->rb.q ); } - vg_line_pt3( w->state.drop_in_target, 0.1f, VG__GREEN ); + vg_line_point( w->state.drop_in_target, 0.1f, VG__GREEN ); v3f p1; v3_muladds( w->state.drop_in_target, w->state.drop_in_normal, 0.3f, p1 ); vg_line( w->state.drop_in_target, p1, VG__GREEN ); @@ -650,7 +650,7 @@ VG_STATIC void player__walk_post_update( player_instance *player ) vg_line( w->state.drop_in_target, p1, VG__GREEN ); vg_line( w->state.drop_in_target, w->state.drop_in_foot_anchor, VG__WHITE ); - vg_line_pt3( w->state.drop_in_foot_anchor, 0.08f, VG__PINK ); + vg_line_point( w->state.drop_in_foot_anchor, 0.08f, VG__PINK ); float a = player_get_heading_yaw( player ); @@ -751,7 +751,12 @@ VG_STATIC void player__walk_animate( player_instance *player, skeleton_lerp_pose( sk, apose, bpose, w->blend_fly, apose ); /* Create transform */ - rb_extrapolate( &player->rb, dest->root_co, dest->root_q ); + if( !player->immobile ) + rb_extrapolate( &player->rb, dest->root_co, dest->root_q ); + else{ + v3_copy( player->rb.co, dest->root_co ); + v4_copy( player->rb.q, dest->root_q ); + } float walk_yaw = player_get_heading_yaw( player );