00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _BOX_H
00026 #define _BOX_H
00027
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031
00032
00033 #include <string>
00034 #include "object.h"
00035 #include "vector3d.h"
00036 #include "aabb.h"
00037
00038 namespace ngn {
00039
00040 using namespace core;
00041
00048 class NGN_API Box : public Object3d
00049 {
00050 public:
00052 Box();
00054 Box( float width, float height, float length, const Vector3df& center );
00056 Box( const Vector3df& min, const Vector3df& max, const Vector3df& center );
00058 Box( const Box& box );
00060 Box( const AABB& aabb );
00062 virtual ~Box();
00064 void setWidth( float width );
00066 void setHeight( float height );
00068 void setLength( float length );
00069
00071 const Vector3df& getMin() const;
00073 const Vector3df& getMax() const;
00075 float getWidth() const;
00077 float getHeight() const;
00079 float getLength() const;
00080
00082 virtual void render( const Camera& cam );
00083
00084 protected:
00086 void calculateMinAndMax();
00088 void calculateSizes();
00090 virtual void computeCentre();
00091
00092 private:
00093 float m_width;
00094 float m_height;
00095 float m_length;
00096
00097 core::Vector3df m_min;
00098
00099 core::Vector3df m_max;
00100
00101 };
00102
00103
00104
00105
00106 }
00107 #endif