diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-12 06:25:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-12 06:25:20 +0300 |
commit | 1d0077649daaa16df5b5dc555d609222e53f7e45 (patch) | |
tree | d806d95948de40474b9770522717dac0793fb469 /source/blender/editors/uvedit/uvedit_intern.h | |
parent | 3a6f26c087a367bae720e59fb019955ea80a5439 (diff) | |
parent | 1966924467c901d541bfe3f510d21a20c29842e3 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_intern.h')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_intern.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index eb92f17544f..c5f16d6fb14 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -50,19 +50,30 @@ void uv_poly_center(struct BMFace *f, float r_cent[2], const int cd_loop_uv_off /* find nearest */ -typedef struct NearestHit { +typedef struct UvNearestHit { + /** Always set if we have a hit. */ struct BMFace *efa; struct BMLoop *l; struct MLoopUV *luv, *luv_next; - int lindex; /* index of loop within face */ -} NearestHit; - -void uv_find_nearest_vert( - struct Scene *scene, struct Image *ima, struct Object *obedit, struct BMEditMesh *em, - const float co[2], const float penalty[2], struct NearestHit *hit); -void uv_find_nearest_edge( - struct Scene *scene, struct Image *ima, struct Object *obedit, struct BMEditMesh *em, - const float co[2], struct NearestHit *hit); + /** Index of loop within face. */ + int lindex; + /** Needs to be set before calling nearest functions. */ + float dist_sq; +} UvNearestHit; + +#define UV_NEAREST_HIT_INIT { .dist_sq = FLT_MAX, } + +bool uv_find_nearest_vert( + struct Scene *scene, struct Image *ima, struct Object *obedit, + const float co[2], const float penalty_dist, struct UvNearestHit *hit_final); + +bool uv_find_nearest_edge( + struct Scene *scene, struct Image *ima, struct Object *obedit, + const float co[2], struct UvNearestHit *hit_final); + +bool uv_find_nearest_face( + struct Scene *scene, struct Image *ima, struct Object *obedit, + const float co[2], struct UvNearestHit *hit_final); /* utility tool functions */ |