ShapeData.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Physics Abstraction Layer                                        *
00004  * Copyright (C) 2004-2005                                               *
00005  * Alan Fischer  alan.fischer@gmail.com                                  *
00006  * Andres Reinot  andres@reinot.com                                      *
00007  * Tyler Streeter  tylerstreeter@gmail.com                               *
00008  * All rights reserved.                                                  *
00009  * Web: opal.sourceforge.net                                             *
00010  *                                                                       *
00011  * This library is free software; you can redistribute it and/or         *
00012  * modify it under the terms of EITHER:                                  *
00013  *   (1) The GNU Lesser General Public License as published by the Free  *
00014  *       Software Foundation; either version 2.1 of the License, or (at  *
00015  *       your option) any later version. The text of the GNU Lesser      *
00016  *       General Public License is included with this library in the     *
00017  *       file license-LGPL.txt.                                          *
00018  *   (2) The BSD-style license that is included with this library in     *
00019  *       the file license-BSD.txt.                                       *
00020  *                                                                       *
00021  * This library is distributed in the hope that it will be useful,       *
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00024  * license-LGPL.txt and license-BSD.txt for more details.                *
00025  *                                                                       *
00026  *************************************************************************/
00027 
00028 #ifndef OPAL_SHAPE_DATA_H
00029 #define OPAL_SHAPE_DATA_H
00030 
00031 // project headers
00032 #include "Defines.h"
00033 #include "Matrix44r.h"
00034 
00035 namespace opal
00036 {
00038         enum ShapeType
00039         {
00040                 BOX_SHAPE,
00041                 SPHERE_SHAPE,
00042                 CAPSULE_SHAPE,
00043                 PLANE_SHAPE,
00044                 //RAY_SHAPE,
00045                 MESH_SHAPE
00046         };
00047 
00050         class ShapeData
00051         {
00052         public:
00053                 OPAL_DECL ShapeData()
00054                 {
00055                         // The initial type doesn't matter since the abstract base
00056                         // class will never be instantiated.
00057                         mType = SPHERE_SHAPE;
00058                         // Leave the offset as an identity matrix.
00059                         material = defaults::shape::material;
00060                         contactGroup = defaults::shape::contactGroup;
00061                 }
00062 
00063                 OPAL_DECL virtual ~ShapeData()
00064                 {
00065                 }
00066 
00068                 OPAL_DECL virtual ShapeType OPAL_CALL getType()const
00069                 {
00070                         return mType;
00071                 }
00072 
00076                 OPAL_DECL virtual void OPAL_CALL getLocalAABB(real aabb[6]) = 0;
00077 
00079                 Matrix44r offset;
00080 
00082                 Material material;
00083 
00086                 unsigned int contactGroup;
00087 
00088         protected:
00090                 ShapeType mType;
00091 
00092         private:
00093         };
00094 }
00095 
00096 #endif
00097 

Generated on Tue May 16 17:49:52 2006 for OPAL by  doxygen 1.4.6-NO