Page principale | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de classe

C:/Projects/ngn/include/box.h

00001 /***************************************************************************
00002  *            box.h
00003  *
00004  *  Sat May  1 13:07:53 2004
00005  *  Copyright  2004  tite
00006  *  thierry.schartz@bluebottle.com
00007  ****************************************************************************/
00008 
00009 /*
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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();      // compute min and max with size data
00088                                         void calculateSizes();          // compute size date with min and max
00090                                         virtual void computeCentre();
00091                                                                                                                         
00092                         private:
00093                                         float m_width;
00094                                         float m_height;
00095                                         float m_length;
00096                                         // min vertex
00097                                         core::Vector3df m_min;                  
00098                                         // max vertex
00099                                         core::Vector3df m_max;  
00100                                         
00101                         };
00102 
00103 
00104 
00105 
00106 }//ngn
00107 #endif /* _BOX_H */

Généré le Fri Nov 19 14:20:28 2004 pour NGN par  doxygen 1.3.9.1