From b7dc0938eb7d59f928bbcf2a3a4877a6f60940e5 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 8 Nov 2010 14:34:44 +0000 Subject: moved clear() from game::Game~ to core::GameServer~ (solves FIXME), unified bounding box code into math::BoundingBox3f class --- src/math/boundingbox3f.cc | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/math/boundingbox3f.cc (limited to 'src/math/boundingbox3f.cc') diff --git a/src/math/boundingbox3f.cc b/src/math/boundingbox3f.cc new file mode 100644 index 0000000..933d783 --- /dev/null +++ b/src/math/boundingbox3f.cc @@ -0,0 +1,53 @@ +/* + math/boundingbox3f.cc + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#include "math/boundingbox3f.h" + +namespace math { + +BoundingBox3f::BoundingBox3f() : + boundingbox_min(), + boundingbox_max() +{ +} + +BoundingBox3f::BoundingBox3f(const Vector3f ¢er) : + boundingbox_min(center), + boundingbox_max(center) +{ +} + +void BoundingBox3f::assign(const BoundingBox3f & other) +{ + boundingbox_min.assign(other.boundingbox_min); + boundingbox_max.assign(other.boundingbox_max); +} + +void BoundingBox3f::assign(const Vector3f ¢er) +{ + boundingbox_min.assign(center); + boundingbox_max.assign(center); +} +void BoundingBox3f::assign(const Vector3f & min, const Vector3f & max) +{ + boundingbox_min.assign(min); + boundingbox_max.assign(max); +} + +void BoundingBox3f::assign(const float min, const float max) +{ + boundingbox_min.assign(min, min, min); + boundingbox_max.assign(max, max, max); +} + +void BoundingBox3f::clear() +{ + boundingbox_min.clear(); + boundingbox_max.clear(); +} + + +} // namespace math -- cgit v1.2.3