fix motion vectors going through gate
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gen.h
index 1648bdf490370113e0b954f1a2d26b8b1c6b7c53..47ed5ee9c9b64624c20bf060c90921f3bb7d8037 100644 (file)
@@ -54,6 +54,8 @@ VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
    mdl_node *mblob = mdl_node_from_name( mfoliage, "blob" );
    mdl_submesh *sm_blob = mdl_node_submesh( mfoliage, mblob, 0 );
 
+   int count = 0;
+
    for( int i=0;i<100000;i++ )
    {
       v3f pos;
@@ -64,7 +66,7 @@ VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
       ray_hit hit;
       hit.dist = INFINITY;
 
-      if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &hit ))
+      if( ray_world( pos, (v3f){0.0001f,-1.0f,0.0001f}, &hit ))
       {
          struct world_material *m1 = ray_hit_material( &hit );
          if((hit.normal[1] > 0.8f) && (m1 == mat) && (hit.pos[1] > 0.0f+10.0f))
@@ -83,9 +85,13 @@ VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
             v3_copy( hit.pos, transform[3] );
             scene_add_submesh( world.scene_no_collide, mfoliage, 
                                sm_blob, transform);
+
+            count ++;
          }
       }
    }
+
+   vg_info( "%d foliage models added\n", count );
 }
 
 VG_STATIC void world_ents_allocate(void)