X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgeometry%2Fintersection.h;h=7d21f75f81c081e87aeb783710a56aab7fe6207e;hb=2087c3bb9e6087ccce86360c1c57823aa8a9ff40;hp=c20aae126d1b021552d430df5fc05a5c1a8ad205;hpb=f7dcf3f0be55316bf20ac0c318dd90cb78a75c80;p=libs%2Fmath.git diff --git a/source/geometry/intersection.h b/source/geometry/intersection.h index c20aae1..7d21f75 100644 --- a/source/geometry/intersection.h +++ b/source/geometry/intersection.h @@ -6,13 +6,10 @@ namespace Msp { namespace Geometry { -/** -Forms a shape from the common parts of component shapes. -*/ template struct IntersectionOps { - static HyperBox combine_aabb(const HyperBox &, const HyperBox &); + static BoundingBox combine_aabb(const BoundingBox &a, const BoundingBox &b) { return a&b; } static bool init_inside() { return true; } static bool combine_inside(bool a, bool b) { return a && b; } static bool is_inside_decided(bool a) { return !a; } @@ -20,6 +17,9 @@ struct IntersectionOps static bool combine_surface(bool a, bool b) { return a && b; } }; +/** +Forms a shape from the common parts of component shapes. +*/ template class Intersection: public CompositeShape > { @@ -54,16 +54,6 @@ inline Intersection *Intersection::clone() const return new Intersection(*this); } - -template -inline HyperBox IntersectionOps::combine_aabb(const HyperBox &box1, const HyperBox &box2) -{ - LinAl::Vector dimensions; - for(unsigned i=0; i(dimensions); -} - } // namespace Geometry } // namespace Msp