routes
[carveJwlIkooP6JGAAIwe30JlM.git] / player.h
index 2860d1934cbbf217bb652ffcb8562255f168da38..b70717eb5076b0fbc8aa3cae33f07f47fe5f29c3 100644 (file)
--- a/player.h
+++ b/player.h
@@ -450,39 +450,6 @@ static void player_physics(void)
    len += rb_sphere_vs_scene( rbf, &world.rb_geo, manifold+len );
    len += rb_sphere_vs_scene( rbb, &world.rb_geo, manifold+len );
 
-#if 0
-   for( int i=0; i<len; i++ )
-   {
-      u32 *ptri = &world.geo.indices[ geo[i]*3 ];
-
-      for( int j=0; j<3; j++ )
-         v3_copy( world.geo.verts[ptri[j]].co, tri[j] );
-
-      vg_line(tri[0],tri[1],0xff00ff00 );
-      vg_line(tri[1],tri[2],0xff00ff00 );
-      vg_line(tri[2],tri[0],0xff00ff00 );
-
-      v3f temp;
-      v3_copy( player.rb.co, temp );
-
-      for( int j=0; j<2; j++ )
-      {
-         if(manifold_count >= vg_list_size(manifold))
-         {
-            vg_error("Manifold overflow!\n");
-            break;
-         }
-
-         rb_ct *ct = &manifold[manifold_count];
-         v3_copy( poles[j], player.rb.co );
-
-         manifold_count += rb_sphere_vs_triangle( &player.rb, tri, ct );
-      }
-
-      v3_copy( temp, player.rb.co );
-   }
-#endif
-
    rb_presolve_contacts( manifold, len );
    v3f surface_avg = {0.0f, 0.0f, 0.0f};
 
@@ -493,8 +460,17 @@ static void player_physics(void)
    else
    {
       for( int i=0; i<len; i++ )
+      {
          v3_add( manifold[i].n, surface_avg, surface_avg );
 
+         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;
+         }
+      }
+
       v3_normalize( surface_avg );
 
       if( v3_dot( player.rb.v, surface_avg ) > 0.5f )