Box.h

00001 /****************************************************************************
00002  * Copyright 2005 Evan Drumwright
00003  * This library is distributed under the terms of the GNU General Public 
00004  * License (found in COPYING).
00005  ****************************************************************************/
00006 
00007 #ifndef _BOX_H
00008 #define _BOX_H
00009 
00010 #include <Physsim/Triangle.h>
00011 #include <Physsim/Matrix3.h>
00012 #include <Physsim/Primitive.h>
00013 
00014 namespace Physsim {
00015 
00017 class Box : public Primitive
00018 {
00019         public:
00020                 Box();
00021                 Box(Real xlen, Real ylen, Real zlen);
00022                 Box(Real xlen, Real ylen, Real zlen, const Matrix4& T);
00023                 Box(const Matrix4& T);
00024                 virtual Vector3 calc_com() const { return _T.get_translation(); }
00025                 void set_size(Real xlen, Real ylen, Real zlen);
00026                 virtual void load_from_xml(XMLTreeConstPtr node, std::map<std::string, BasePtr>& id_map);
00027                 virtual void save_to_xml(XMLTreePtr node, std::list<BaseConstPtr>& shared_objects) const;
00028                 virtual Real calc_mass();
00029                 virtual Matrix3 calc_inertia();
00030                 virtual SoNode* create_visualization();
00031 
00032         private:
00033                 void recompute_mesh();
00034 
00035                 Real _xlen, _ylen, _zlen;
00036 }; // end class
00037 } // end namespace
00038 
00039 #endif

Generated on Wed Oct 24 14:54:21 2007 for Physsim by  doxygen 1.5.1