X-Git-Url: https://harrygodden.com/git/?p=csRadar.git;a=blobdiff_plain;f=vmf.h;fp=vmf.h;h=4fbe023c568867a5ba5cb6ab0a4ae90c581dbe99;hp=c5f736b4474977214d8ef543dbb79ba1029c4a0d;hb=dee56773cecd3a165331732008b7c0acf6f13393;hpb=abfc6360542cb480122313a36f6ed02c08074ed5 diff --git a/vmf.h b/vmf.h index c5f736b..4fbe023 100644 --- a/vmf.h +++ b/vmf.h @@ -43,7 +43,7 @@ void vmf_load_models( vmf_map *map ); // Create matrix describing this entities transform void vmf_entity_transform( vdf_node *ent, m4x3f mat ); -u32 vmf_visgroup_id( vdf_node *root, const char *name ); +int vmf_visgroup_id( vdf_node *root, const char *name ); int vmf_visgroup_match( vdf_node *ent, u32 target ); // Currently unused @@ -74,7 +74,7 @@ struct vmf_vert { v3f co; v3f nrm; - v2f xy; + v3f origin; }; struct vmf_face @@ -422,7 +422,7 @@ ESolidResult solidgen_push( vmf_solid *ctx, vdf_node *node ) v3_divs( center, (float)numpoints, center ); for( ; vert_start < csr_sb_count( ctx->verts ); vert_start ++ ) { - v2_copy( center, ctx->verts[ vert_start ].xy ); + v3_copy( center, ctx->verts[ vert_start ].origin ); } // Sort each faces and trianglulalate them @@ -522,6 +522,9 @@ ESolidResult solidgen_push( vmf_solid *ctx, vdf_node *node ) // Todo, put correct normal v3_copy( (v3f){ 0.f, 0.f, 1.f }, vert->nrm ); + + // Todo: use real bounds of displaced vertices + v3_copy( center, vert->origin ); } } @@ -817,7 +820,7 @@ void vmf_entity_transform( vdf_node *ent, m4x3f mat ) m4x3_scale( mat, scale ); } -u32 vmf_visgroup_id( vdf_node *root, const char *name ) +int vmf_visgroup_id( vdf_node *root, const char *name ) { vdf_node *dict = vdf_next( root, "visgroups", NULL ); @@ -832,7 +835,7 @@ u32 vmf_visgroup_id( vdf_node *root, const char *name ) } } - return 0; + return -1; } int vmf_visgroup_match( vdf_node *ent, u32 target )