SphereShapeData.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_SPHERE_SHAPE_DATA_H
00029 #define OPAL_SPHERE_SHAPE_DATA_H
00030 
00031 #include "Defines.h"
00032 #include "ShapeData.h"
00033 
00034 namespace opal
00035 {
00037         class SphereShapeData : public ShapeData
00038         {
00039         public:
00040                 OPAL_DECL SphereShapeData()
00041                 : ShapeData()
00042                 {
00043                         mType = SPHERE_SHAPE;
00044                         radius = defaults::shape::sphereRadius;
00045                 }
00046 
00048                 OPAL_DECL SphereShapeData(const SphereShapeData& data)
00049                 {
00050                         (*this) = data;
00051                 }
00052 
00053                 OPAL_DECL virtual ~SphereShapeData()
00054                 {
00055                 }
00056 
00058                 OPAL_DECL virtual void OPAL_CALL operator=(
00059                         const SphereShapeData& data)
00060                 {
00061                         mType = data.mType;
00062                         offset = data.offset;
00063                         material = data.material;
00064                         contactGroup = data.contactGroup;
00065                         radius = data.radius;
00066                 }
00067 
00068                 OPAL_DECL virtual void OPAL_CALL getLocalAABB(real aabb[6])
00069                 {
00070                         aabb[0] = -radius;
00071                         aabb[1] = radius;
00072                         aabb[2] = -radius;
00073                         aabb[3] = radius;
00074                         aabb[4] = -radius;
00075                         aabb[5] = radius;
00076                 }
00077 
00079                 real radius;
00080 
00081         protected:
00082 
00083         private:
00084         };
00085 }
00086 
00087 #endif

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