Add option to set object origin to the center of mass

This uses the weighted average of polygon centroids based on area
It work well in most cases but will be slightly wrong when polygons have 
many vertices.
This commit is contained in:
2012-10-20 16:48:54 +00:00
parent d20128bbbc
commit 0a590aadf5
3 changed files with 32 additions and 2 deletions

View File

@@ -292,6 +292,7 @@ void create_vert_edge_map(MeshElemMap **map, int **mem,
int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]);
int BKE_mesh_center_median(struct Mesh *me, float cent[3]);
int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]);
int BKE_mesh_center_centroid(struct Mesh *me, float cent[3]);
void BKE_mesh_translate(struct Mesh *me, float offset[3], int do_keys);
/* mesh_validate.c */