build system revision
[carveJwlIkooP6JGAAIwe30JlM.git] / testing.c
index af79381488b15d3846d25dcaa27566c364644586..a71806ccab935a1eba73743b41dce46ea0243455 100644 (file)
--- a/testing.c
+++ b/testing.c
@@ -1,6 +1,7 @@
 #pragma once
 #include "vg/vg_m.h"
 #include "vg/vg_rigidbody.h"
+#include "vg/vg_input.h"
 #include "scene_rigidbody.h"
 
 struct {
@@ -14,6 +15,9 @@ static baller = {
 };
 
 static void testing_update(void){
+   if( !vg_console.cheats )
+      return;
+
    if( vg_getkey( SDLK_9 ) ){
       v3_add( localplayer.rb.co, (v3f){0,1,0}, baller.rb.co );
       v3_zero( baller.rb.w );
@@ -21,6 +25,13 @@ static void testing_update(void){
       q_identity( baller.rb.q );
       rb_update_matrices( &baller.rb );
    }
+
+   if( vg_getkey( SDLK_8 ) ){
+      localplayer.have_glider = 1;
+      localplayer.glider_orphan = 0;
+      player_glide.t = -1.0f;
+   }
+
    vg_line_boxf_transformed( baller.rb.to_world, baller.box, VG__RED );
 
    world_instance *world = world_current_instance();
@@ -39,7 +50,8 @@ static void testing_update(void){
       buf[j].rbb = &_null;
    }
 
-   rb_presolve_contacts( rb_contact_buffer, rb_contact_count );
+   rb_presolve_contacts( rb_contact_buffer, 
+                         vg.time_fixed_delta, rb_contact_count );
 
    for( u32 i=0; i<8; i ++ )
       rb_solve_contacts( rb_contact_buffer, rb_contact_count );