X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.h;h=b05714e4e893209fe2198628700419d72c600c50;hb=1030b1e134d422a3cbc1e06102053447da59ceba;hp=b70717eb5076b0fbc8aa3cae33f07f47fe5f29c3;hpb=d57b7661518800479c00300ce57407378696eec9;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.h b/player.h index b70717e..b05714e 100644 --- a/player.h +++ b/player.h @@ -33,7 +33,7 @@ static int walk_grid_iterations = 1; static struct gplayer { /* Physics */ - rigidbody rb, collide_front, collide_back; + rigidbody rb, collide_front, collide_back, rb_gate_frame; v3f a, v_last, m, bob, vl; @@ -463,12 +463,14 @@ static void player_physics(void) { v3_add( manifold[i].n, surface_avg, surface_avg ); +#if 0 if( manifold[i].element_id <= world.sm_geo_std_oob.vertex_count ) { player.is_dead = 1; character_ragdoll_copypose( &player.mdl, player.rb.v ); return; } +#endif } v3_normalize( surface_avg ); @@ -600,9 +602,10 @@ static void player_do_motion(void) /* * Gate intersection, by tracing a line over the gate planes */ - for( int i=0; igate; if( gate_intersect( gate, player.rb.co, prevco ) ) { @@ -616,7 +619,9 @@ static void player_do_motion(void) v4f transport_rotation; m3x3_q( gate->transport, transport_rotation ); q_mul( transport_rotation, player.rb.q, player.rb.q ); - + + world_routes_activate_gate( i ); + player.rb_gate_frame = player.rb; break; } } @@ -1980,6 +1985,8 @@ static int reset_player( int argc, char const *argv[] ) rb_update_transform( &player.rb ); m3x3_mulv( player.rb.to_world, (v3f){ 0.0f, 0.0f, -1.2f }, player.rb.v ); + + player.rb_gate_frame = player.rb; return 1; } @@ -1990,7 +1997,15 @@ static void player_update(void) player.land_target_colours[i], 0.25f); if( vg_get_axis("grabl")>0.0f) - reset_player(0,NULL); + { + player.rb = player.rb_gate_frame; + player.is_dead = 0; + player.in_air = 1; + m3x3_identity( player.vr ); + + player.mdl.shoes[0] = 1; + player.mdl.shoes[1] = 1; + } if( vg_get_button_down( "switchmode" ) ) {