Revision: 9000
http://playerstage.svn.sourceforge.net/playerstage/?rev=9000&view=rev
Author: natepak
Date: 2010-12-02 14:43:12 +0000 (Thu, 02 Dec 2010)
Log Message:
-----------
Added Box
Added Paths:
-----------
code/gazebo/branches/dev/server/Box.cc
code/gazebo/branches/dev/server/Box.hh
Added: code/gazebo/branches/dev/server/Box.cc
===================================================================
--- code/gazebo/branches/dev/server/Box.cc (rev 0)
+++ code/gazebo/branches/dev/server/Box.cc 2010-12-02 14:43:12 UTC (rev
9000)
@@ -0,0 +1,37 @@
+#include "Box.hh"
+
+using namespace gazebo;
+
+////////////////////////////////////////////////////////////////////////////////
+/// Constructor
+Box::Box (const Vector3 min, const Vector3 max)
+ : min(min), max(max)
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Destructor
+Box::~Box()
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Get the length along the x dimension
+double Box::GetXLength()
+{
+ return fabs(max.x - min.x);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Get the length along the y dimension
+double Box::GetYLength()
+{
+ return fabs(max.y - min.y);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Get the length along the z dimension
+double Box::GetZLength()
+{
+ return fabs(max.z - min.z);
+}
Added: code/gazebo/branches/dev/server/Box.hh
===================================================================
--- code/gazebo/branches/dev/server/Box.hh (rev 0)
+++ code/gazebo/branches/dev/server/Box.hh 2010-12-02 14:43:12 UTC (rev
9000)
@@ -0,0 +1,29 @@
+#ifndef BOX_HH
+#define BOX_HH
+
+#include "Vector3.hh"
+
+namespace gazebo
+{
+ class Box
+ {
+ /// \brief Constructor
+ public: Box (const Vector3 min, const Vector3 max);
+
+ /// \brief Destructor
+ public: virtual ~Box();
+
+ /// \brief Get the length along the x dimension
+ public: double GetXLength();
+
+ /// \brief Get the length along the y dimension
+ public: double GetYLength();
+
+ /// \brief Get the length along the z dimension
+ public: double GetZLength();
+
+ public: Vector3 min, max;
+ };
+}
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit