2 * Copyright (c) 2006 Erwin Coumans http://continuousphysics.com/Bullet/
4 * Permission to use, copy, modify, distribute and sell this software
5 * and its documentation for any purpose is hereby granted without fee,
6 * provided that the above copyright notice appear in all copies.
7 * Erwin Coumans makes no representations about the suitability
8 * of this software for any purpose.
9 * It is provided "as is" without express or implied warranty.
12 #include "StridingMeshInterface.h"
15 class TriangleIndexVertexArray : public StridingMeshInterface
18 int m_numTriangleIndices;
19 int* m_triangleIndexBase;
20 int m_triangleIndexStride;
27 TriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,float* vertexBase,int vertexStride);
29 virtual void getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0);
31 virtual void getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const;
33 /// unLockVertexBase finishes the access to a subpart of the triangle mesh
34 /// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
35 virtual void unLockVertexBase(int subpart) {}
37 virtual void unLockReadOnlyVertexBase(int subpart) const {}
39 /// getNumSubParts returns the number of seperate subparts
40 /// each subpart has a continuous array of vertices and indices
41 virtual int getNumSubParts() const { return 1;}
43 virtual void preallocateVertices(int numverts){}
44 virtual void preallocateIndices(int numindices){}