Subject: [ggl] box/box clipping
From: Barend Gehrels (barend.gehrels)
Date: 2010-12-29 04:53:04
Op 29-12-2010 8:51, Arash Partow schreef:
> On 28/12/2010 11:00 PM, barend wrote:
>> If this all is possible, with or without is_range (it probably is), the
>> function would look like
>> bool intersection(Box const& b1, Box const& b2, Box& clipped), so the
>> function you proposed but with the old name...
> What if one only wants to know if the boxes intersect? that check if
> done for AABB's is _far cheaper_ than actually constructing the
> intersection box itself(and far more common). In that scenario what
> would the function look like?
The user can call the function intersects then.
template <typename Geometry1, typename Geometry2>
bool intersects(Geometry2 const& a, Geometry2 const& b)
Or ! disjoint, which is similar.
Geometry list run by mateusz at loskot.net