Add Mesh equivalent to BM_edge_other_vert().

/* Return the index of the edge vert that is not equal to 'v'. If
 * neither edge vertex is equal to 'v', returns -1. */
int BKE_mesh_edge_other_vert(const struct MEdge *e, int v);
This commit is contained in:
2012-05-22 15:28:44 +00:00
parent 5e22802fae
commit f7b116e0bd
2 changed files with 16 additions and 0 deletions

View File

@@ -111,6 +111,10 @@ int poly_find_loop_from_vert(const struct MPoly *poly,
int poly_get_adj_loops_from_vert(unsigned adj_r[3], const struct MPoly *poly,
const struct MLoop *mloop, unsigned vert);
/* Return the index of the edge vert that is not equal to 'v'. If
* neither edge vertex is equal to 'v', returns -1. */
int BKE_mesh_edge_other_vert(const struct MEdge *e, int v);
/* update the hide flag for edges and polys from the corresponding
* flag in verts */
void BKE_mesh_flush_hidden_from_verts(const struct MVert *mvert,

View File

@@ -2996,6 +2996,18 @@ int poly_get_adj_loops_from_vert(unsigned adj_r[3], const MPoly *poly,
return corner;
}
/* Return the index of the edge vert that is not equal to 'v'. If
* neither edge vertex is equal to 'v', returns -1. */
int BKE_mesh_edge_other_vert(const MEdge *e, int v)
{
if (e->v1 == v)
return e->v2;
else if (e->v2 == v)
return e->v1;
else
return -1;
}
/* update the hide flag for edges and faces from the corresponding
* flag in verts */
void BKE_mesh_flush_hidden_from_verts(const MVert *mvert,