X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_walk.c;h=8b493a8e49a7c1856ab7cfeb94f824e6e19b3c47;hb=ce0205fd929e5fb1446f8c52fcab344884d82569;hp=ad58c7317617e21aea774d125d0c2dd6a007e5e7;hpb=22f62f001f21d1b91fefd9fc495c122d9ddf205a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_walk.c b/player_walk.c index ad58c73..8b493a8 100644 --- a/player_walk.c +++ b/player_walk.c @@ -282,7 +282,7 @@ static void player__walk_pre_update(void){ localplayer.immobile = 1; struct player_avatar *av = localplayer.playeravatar; - m4x3_mulv( av->sk.final_mtx[ av->id_ik_foot_r ], + m4x3_mulv( localplayer.final_mtx[ av->id_ik_foot_r ], av->sk.bones[ av->id_ik_foot_r ].co, w->state.drop_in_foot_anchor ); } @@ -617,9 +617,9 @@ static void player__walk_update(void){ } } - ent_gate *gate = - world_intersect_gates( world, localplayer.rb.co, w->state.prev_pos ); - if( gate ){ + u32 id = world_intersect_gates(world, localplayer.rb.co, w->state.prev_pos); + if( id ){ + ent_gate *gate = mdl_arritm( &world->ent_gate, mdl_entity_id_id(id) ); m4x3_mulv( gate->transport, localplayer.rb.co, localplayer.rb.co ); m3x3_mulv( gate->transport, localplayer.rb.v, localplayer.rb.v ); @@ -628,7 +628,7 @@ static void player__walk_update(void){ q_mul( transport_rotation, localplayer.rb.q, localplayer.rb.q ); rb_update_transform( &localplayer.rb ); - player__pass_gate( gate ); + player__pass_gate( id ); } rb_update_transform( &localplayer.rb ); } @@ -962,4 +962,21 @@ static void player__walk_reset( ent_spawn *rp ){ w->state.outro_start_time = 0.0; } +static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){ + struct player_walk_animator *animator = data; + + bitpack_qv3f( ctx, 24, -1024.0f, 1024.0f, animator->root_co ); + bitpack_qquat( ctx, animator->root_q ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->fly ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->run ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->walk ); + bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->walk_timer ); + + bitpack_bytes( ctx, 8, &animator->outro_type ); + if( animator->outro_type ){ + bitpack_bytes(ctx, sizeof(animator->foot_anchor), animator->foot_anchor ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t ); + bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t ); + } +} #endif /* PLAYER_DEVICE_WALK_H */