Back to index

supertuxkart  0.5+dfsg1
btStridingMeshInterface.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 STRIDING_MESHINTERFACE_H
00017 #define STRIDING_MESHINTERFACE_H
00018 
00019 #include "LinearMath/btVector3.h"
00020 #include "btTriangleCallback.h"
00021 
00024 typedef enum PHY_ScalarType {
00025        PHY_FLOAT,
00026        PHY_DOUBLE,
00027        PHY_INTEGER,
00028        PHY_SHORT,
00029        PHY_FIXEDPOINT88
00030 } PHY_ScalarType;
00031 
00034 class  btStridingMeshInterface
00035 {
00036        protected:
00037        
00038               btVector3 m_scaling;
00039 
00040        public:
00041               btStridingMeshInterface() :m_scaling(btScalar(1.),btScalar(1.),btScalar(1.))
00042               {
00043 
00044               }
00045 
00046               virtual ~btStridingMeshInterface();
00047 
00048 
00049 
00050               void   InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const;
00051 
00053               void   calculateAabbBruteForce(btVector3& aabbMin,btVector3& aabbMax);
00054 
00060               virtual void  getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0)=0;
00061               
00062               virtual void  getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const=0;
00063        
00066               virtual void  unLockVertexBase(int subpart)=0;
00067 
00068               virtual void  unLockReadOnlyVertexBase(int subpart) const=0;
00069 
00070 
00073               virtual int          getNumSubParts() const=0;
00074 
00075               virtual void  preallocateVertices(int numverts)=0;
00076               virtual void  preallocateIndices(int numindices)=0;
00077 
00078               const btVector3&     getScaling() const {
00079                      return m_scaling;
00080               }
00081               void   setScaling(const btVector3& scaling)
00082               {
00083                      m_scaling = scaling;
00084               }
00085 
00086        
00087 
00088 };
00089 
00090 #endif //STRIDING_MESHINTERFACE_H