Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-08 14:34:44 +0000
committerStijn Buys <ingar@osirion.org>2010-11-08 14:34:44 +0000
commitb7dc0938eb7d59f928bbcf2a3a4877a6f60940e5 (patch)
tree5b4b4353f2012fced4180072e0b0def8ba8d22db /src/math/boundingbox3f.cc
parentb685a594ae43aa30173912c9fb1177d507ec5a08 (diff)
moved clear() from game::Game~ to core::GameServer~ (solves FIXME),
unified bounding box code into math::BoundingBox3f class
Diffstat (limited to 'src/math/boundingbox3f.cc')
-rw-r--r--src/math/boundingbox3f.cc53
1 files changed, 53 insertions, 0 deletions
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 &center) :
+ 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 &center)
+{
+ 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