+ /*
+ * TODO: Load any other meshes into the foliage scene, and create rbs for
+ * them.
+ *
+ * then compute bvh
+ */
+#if 0
+ scene_add_foliage( &world.foliage, mworld, boxtest, world.box.to_world );
+#endif
+
+
+#if 0
+ submodel *boxtest = submodel_get( mworld, "cubey" );
+
+#endif
+
+ for( int i=0; i<mworld->layer_count; i++ )
+ {
+ submodel *sm = model_get_submodel( mworld, i );
+ if( !strcmp( sm->material, "surf" ) ||
+ !strcmp( sm->material, "terrain" ) ||
+ !strcmp( sm->material, "water" ) )
+ continue;
+
+ m4x3f transform;
+ q_m3x3( sm->q, transform );
+ v3_copy( sm->pivot, transform[3] );
+ scene_add_foliage( &world.foliage, mworld, sm, transform );
+
+ rigidbody *rb = &world.temp_rbs[ world.rb_count ++ ];
+
+ box_copy( sm->bbx, rb->bbx );
+ v3_copy( sm->pivot, rb->co );
+ rb_init( rb );
+ v4_copy( sm->q, rb->q );
+ rb_update_transform( rb );
+ }
+
+
+ free( mworld );
+