geom/segment: instantiate bounds for segments
This commit is contained in:
parent
382e093f57
commit
4f9014a151
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "segment.hpp"
|
#include "segment.hpp"
|
||||||
|
|
||||||
|
#include "aabb.hpp"
|
||||||
#include "ops.hpp"
|
#include "ops.hpp"
|
||||||
|
|
||||||
#include "../region.hpp"
|
#include "../region.hpp"
|
||||||
@ -66,3 +67,15 @@ cruft::geom::intersects (cruft::geom::segment2i seg, cruft::region2i rect)
|
|||||||
{
|
{
|
||||||
return intersects (seg.cast<float> (), rect.cast<float> ());
|
return intersects (seg.cast<float> (), rect.cast<float> ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
template <>
|
||||||
|
cruft::geom::aabb3f
|
||||||
|
cruft::geom::bounds (cruft::geom::segment3f obj)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
min (obj.a, obj.b),
|
||||||
|
max (obj.a, obj.b),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user