diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-16 19:28:18 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-16 19:28:26 +0300 |
commit | 399168f3c13fadb41c9fbec8a1b5c56cb6609343 (patch) | |
tree | 6642554c8927280a8ba49bd9c329f2a133afa60a /source/blender/blenlib/intern/delaunay_2d.cc | |
parent | 5b3a415a59cef7183a2539fcc12de8fd1ebf8814 (diff) |
BLI: Implement templated math functions for basic types
This is meant to complement the `blender::math` functions recently
added by D13791. It's sometimes desired to template an operation to work
on vector types, but also basic types like `float` and `int`. This patch
adds that ability with a new `BLI_math_base.hh` header.
The existing vector math header is changed to use the `vec_base` type
more explicitly, to allow the compiler's generic function overload resolution
to determine which implementation of each math function to use.
This is a relatively large change, but it also makes the file significantly
easier to understand by reducing the use of macros.
Differential Revision: https://developer.blender.org/D14113
Diffstat (limited to 'source/blender/blenlib/intern/delaunay_2d.cc')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index cb0ba763c94..cc5550ee34a 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -1691,7 +1691,7 @@ void fill_crossdata_for_intersect(const FatCo<T> &curco, BLI_assert(se_vcva->vert == vc && se_vcva->next->vert == va); BLI_assert(se_vcvb->vert == vc && se_vcvb->next->vert == vb); UNUSED_VARS_NDEBUG(vc); - auto isect = isect_seg_seg<vec2<T>>(va->co.exact, vb->co.exact, curco.exact, v2->co.exact); + auto isect = isect_seg_seg(va->co.exact, vb->co.exact, curco.exact, v2->co.exact); T &lambda = isect.lambda; switch (isect.kind) { case isect_result<vec2<T>>::LINE_LINE_CROSS: { @@ -2556,7 +2556,7 @@ template<typename T> void detect_holes(CDT_state<T> *cdt_state) if (e->symedges[0].face->visit_index == e->symedges[1].face->visit_index) { continue; /* Don't count hits on edges between faces in same region. */ } - auto isect = isect_seg_seg<vec2<T>>(ray_end.exact, + auto isect = isect_seg_seg(ray_end.exact, mid.exact, e->symedges[0].vert->co.exact, e->symedges[1].vert->co.exact); |