Back to index

supertuxkart  0.5+dfsg1
btTetrahedronShape.h
Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004 
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose, 
00008 including commercial applications, and to alter it and redistribute it freely, 
00009 subject to the following restrictions:
00010 
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 
00016 #ifndef BU_SIMPLEX_1TO4_SHAPE
00017 #define BU_SIMPLEX_1TO4_SHAPE
00018 
00019 
00020 #include "btPolyhedralConvexShape.h"
00021 #include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
00022 
00023 
00025 class btBU_Simplex1to4 : public btPolyhedralConvexShape
00026 {
00027 protected:
00028 
00029        int    m_numVertices;
00030        btPoint3      m_vertices[4];
00031 
00032 public:
00033        btBU_Simplex1to4();
00034 
00035        btBU_Simplex1to4(const btPoint3& pt0);
00036        btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1);
00037        btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2);
00038        btBU_Simplex1to4(const btPoint3& pt0,const btPoint3& pt1,const btPoint3& pt2,const btPoint3& pt3);
00039 
00040     
00041        void   reset()
00042        {
00043               m_numVertices = 0;
00044        }
00045        
00046 
00047        virtual int   getShapeType() const{ return TETRAHEDRAL_SHAPE_PROXYTYPE; }
00048 
00049        void addVertex(const btPoint3& pt);
00050 
00051        //PolyhedralConvexShape interface
00052 
00053        virtual int   getNumVertices() const;
00054 
00055        virtual int getNumEdges() const;
00056 
00057        virtual void getEdge(int i,btPoint3& pa,btPoint3& pb) const;
00058        
00059        virtual void getVertex(int i,btPoint3& vtx) const;
00060 
00061        virtual int   getNumPlanes() const;
00062 
00063        virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const;
00064 
00065        virtual int getIndex(int i) const;
00066 
00067        virtual       bool isInside(const btPoint3& pt,btScalar tolerance) const;
00068 
00069 
00071        virtual const char*  getName()const { return "btBU_Simplex1to4";}
00072 
00073 };
00074 
00075 #endif //BU_SIMPLEX_1TO4_SHAPE