X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=scene.h;h=83badb2fbca423444213dc3825af14e633bf25a3;hb=8a31c1ffcb632b9b6d1702332f0d75d609c0a87b;hp=13de419f2542d4f300087babb87ebbe581df49d7;hpb=3494503be52ee50b21e78c8ada30620210db6511;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/scene.h b/scene.h index 13de419..83badb2 100644 --- a/scene.h +++ b/scene.h @@ -135,19 +135,22 @@ VG_STATIC void scene_add_mdl_submesh( scene_context *ctx, mdl_context *mdl, u32 real_indices = 0; for( u32 i=0; iindice_count/3; i++ ){ - u32 *tri = &src_indices[i*3]; + u32 *src = &src_indices[i*3], + *dst = &dst_indices[real_indices]; v3f ab, ac, tn; - v3_sub( src_verts[tri[2]].co, src_verts[tri[0]].co, ab ); - v3_sub( src_verts[tri[1]].co, src_verts[tri[0]].co, ac ); + v3_sub( src_verts[src[2]].co, src_verts[src[0]].co, ab ); + v3_sub( src_verts[src[1]].co, src_verts[src[0]].co, ac ); v3_cross( ac, ab, tn ); +#if 0 if( v3_length2( tn ) <= 0.00001f ) continue; +#endif - dst_indices[real_indices+0] = tri[0] + ctx->vertex_count; - dst_indices[real_indices+1] = tri[1] + ctx->vertex_count; - dst_indices[real_indices+2] = tri[2] + ctx->vertex_count; + dst[0] = src[0] + ctx->vertex_count; + dst[1] = src[1] + ctx->vertex_count; + dst[2] = src[2] + ctx->vertex_count; real_indices += 3; }