adjust input filtering
[carveJwlIkooP6JGAAIwe30JlM.git] / world_routes.c
index 0bfdcac8bf92ac1406032a6f0c427f73e04ecad4..ca072e62985290569c6a7d780e2ed0b588efea99 100644 (file)
@@ -315,8 +315,8 @@ void world_routes_place_curve( world_instance *world, ent_route *route,
             v3_muladds( ha.pos, up, 0.06f+gap, va.co );
             v3_muladds( hb.pos, up, 0.06f+gap, vb.co );
 
-            scene_vert_pack_norm( &va, up );
-            scene_vert_pack_norm( &vb, up );
+            scene_vert_pack_norm( &va, up, 0.0f );
+            scene_vert_pack_norm( &vb, up, 0.0f );
 
             float t1 = (travel_length / total_length) * patch_count;
             va.uv[0] = t1;
@@ -488,7 +488,6 @@ static void world_gen_routes_generate( u32 instance_id ){
    vg_info( "Generating route meshes\n" );
    vg_async_stall();
 
-   vg_rand_seed( 2000 );
    vg_async_item *call_scene = scene_alloc_async( &world->scene_lines, 
                                                   &world->mesh_route_lines,
                                                   200000, 300000 );
@@ -698,7 +697,7 @@ static void world_routes_fixedupdate( world_instance *world ){
    rb_presolve_contacts( rb_contact_buffer, rb_contact_count );
 
    for( int i=0; i<rb_contact_count; i++ ){
-      rb_contact_restitution( rb_contact_buffer+i, vg_randf64() );
+      rb_contact_restitution( rb_contact_buffer+i, vg_randf64(&vg.rand) );
    }
 
    for( int i=0; i<6; i++ ){
@@ -882,13 +881,13 @@ static void world_routes_fracture( world_instance *world, ent_gate *gate,
             v3_muls( origin, -1.0f, particle->mlocal[3] );
 
             v3_copy( world_co, particle->obj.rb.co );
-            v3_muls( imp_v, 1.0f+vg_randf64(), particle->obj.rb.v );
+            v3_muls( imp_v, 1.0f+vg_randf64(&vg.rand), particle->obj.rb.v );
             particle->obj.rb.v[1] += 2.0f;
 
             v4_copy( q, particle->obj.rb.q );
-            particle->obj.rb.w[0] = vg_randf64()*2.0f-1.0f;
-            particle->obj.rb.w[1] = vg_randf64()*2.0f-1.0f;
-            particle->obj.rb.w[2] = vg_randf64()*2.0f-1.0f;
+            particle->obj.rb.w[0] = vg_randf64(&vg.rand)*2.0f-1.0f;
+            particle->obj.rb.w[1] = vg_randf64(&vg.rand)*2.0f-1.0f;
+            particle->obj.rb.w[2] = vg_randf64(&vg.rand)*2.0f-1.0f;
 
             particle->obj.type = k_rb_shape_sphere;
             particle->obj.inf.sphere.radius = r*0.6f;
@@ -904,7 +903,10 @@ static void render_gate_markers( m4x3f world_mmdl, int run_id, ent_gate *gate ){
    for( u32 j=0; j<4; j++ ){
       if( gate->routes[j] == run_id ){
          m4x3f mmdl;
-         ent_gate_get_mdl_mtx( gate, mmdl );
+         m4x3_copy( gate->to_world, mmdl );
+         m3x3_scale( mmdl, (v3f){ gate->dimensions[0], 
+                                  gate->dimensions[1], 1.0f } );
+
          m4x3_mul( world_mmdl, mmdl, mmdl );
          shader_model_gate_uMdl( mmdl );
          mdl_draw_submesh( &world_gates.sm_marker[j] );