geom/region: add 'bounds' specialisation for region
This commit is contained in:
parent
e6bd571fd5
commit
2a4401da98
@ -354,6 +354,7 @@ list (
|
||||
geom/ray.hpp
|
||||
geom/rect.cpp
|
||||
geom/rect.hpp
|
||||
geom/region.cpp
|
||||
geom/sample/fwd.hpp
|
||||
geom/sample/edge.hpp
|
||||
geom/sample/surface.hpp
|
||||
|
25
geom/region.cpp
Normal file
25
geom/region.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* Copyright 2019 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
#include "ops.hpp"
|
||||
|
||||
#include "aabb.hpp"
|
||||
#include "../region.hpp"
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Bounds calculation for a region is effectively just a type conversion
|
||||
template <>
|
||||
cruft::geom::aabb<2,float>
|
||||
cruft::geom::bounds (region<2,float> val)
|
||||
{
|
||||
return aabb2f {
|
||||
val.base (),
|
||||
val.away ()
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user