diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-05 15:43:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-05 15:43:51 +0300 |
commit | 6cba20a8e60513ce73c4a75f44caafb854b359a1 (patch) | |
tree | c661567c8612ea4040c3fb8e7bf7529b43b1f171 /source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c | |
parent | 5b76f72904f83a80525cbea9cca4881358961bc0 (diff) |
OpenSubdiv: Tweaks to AABB calculation when using opensubdiv for subsurf
Use coarse coordinates to calculate AABB which gives much better approximation
of AABB than using unity AABB size.
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c index 81f9ea6dc16..882ede09d29 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c @@ -876,4 +876,13 @@ void ccgSubSurf_free_osd_mesh(CCGSubSurf *ss) } } +void ccgSubSurf_getMinMax(CCGSubSurf *ss, float r_min[3], float r_max[3]) +{ + int i; + BLI_assert(ss->use_grids == false); + for (i = 0; i < ss->osd_num_coarse_coords; i++) { + DO_MINMAX(ss->osd_coarse_coords[i], r_min, r_max); + } +} + #endif /* WITH_OPENSUBDIV */ |