Back to index

supertuxkart  0.5+dfsg1
btShapeHull.h
Go to the documentation of this file.
00001 /*
00002 btShapeHull implemented by John McCutchan.
00003 
00004 Bullet Continuous Collision Detection and Physics Library
00005 Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/
00006 
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012 
00013 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.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 
00018 #ifndef _SHAPE_HULL_H
00019 #define _SHAPE_HULL_H
00020 
00021 #include "LinearMath/btAlignedObjectArray.h"
00022 #include "BulletCollision/CollisionShapes/btConvexShape.h"
00023 
00024 
00026 class btShapeHull
00027 {
00028 public:
00029        btShapeHull (const btConvexShape* shape);
00030        ~btShapeHull ();
00031 
00032        bool buildHull (btScalar margin);
00033 
00034        int numTriangles () const;
00035        int numVertices () const;
00036        int numIndices () const;
00037 
00038        const btVector3* getVertexPointer() const
00039        {
00040               return &m_vertices[0];
00041        }
00042        const unsigned int* getIndexPointer() const
00043        {
00044               return &m_indices[0];
00045        }
00046 
00047 protected:
00048        btAlignedObjectArray<btVector3> m_vertices;
00049        btAlignedObjectArray<unsigned int> m_indices;
00050        unsigned int m_numIndices;
00051        const btConvexShape* m_shape;
00052 };
00053 
00054 #endif //_SHAPE_HULL_H