Back to index

supertuxkart  0.5+dfsg1
btTriangleMesh.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 
00017 #ifndef TRIANGLE_MESH_H
00018 #define TRIANGLE_MESH_H
00019 
00020 #include "btTriangleIndexVertexArray.h"
00021 #include "LinearMath/btVector3.h"
00022 #include "LinearMath/btAlignedObjectArray.h"
00023 
00028 class btTriangleMesh : public btTriangleIndexVertexArray
00029 {
00030        btAlignedObjectArray<btVector3>    m_4componentVertices;
00031        btAlignedObjectArray<float>        m_3componentVertices;
00032 
00033        btAlignedObjectArray<int>          m_32bitIndices;
00034        btAlignedObjectArray<short int>           m_16bitIndices;
00035        bool   m_use32bitIndices;
00036        bool   m_use4componentVertices;
00037 
00038 
00039        public:
00040               btTriangleMesh (bool use32bitIndices=true,bool use4componentVertices=true);
00041 
00042               bool   getUse32bitIndices() const
00043               {
00044                      return m_use32bitIndices;
00045               }
00046 
00047               bool   getUse4componentVertices() const
00048               {
00049                      return m_use4componentVertices;
00050               }
00051               
00052               void   addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2);
00053               
00054               int getNumTriangles() const;
00055 
00056               virtual void  preallocateVertices(int numverts){(void) numverts;}
00057               virtual void  preallocateIndices(int numindices){(void) numindices;}
00058 
00059               
00060 };
00061 
00062 #endif //TRIANGLE_MESH_H
00063