Bullet Collision Detection & Physics Library
Public Member Functions | Protected Attributes | List of all members
btTriangleIndexVertexArray Class Reference

The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing triangle/index arrays. More...

#include <btTriangleIndexVertexArray.h>

Inheritance diagram for btTriangleIndexVertexArray:
Inheritance graph
[legend]
Collaboration diagram for btTriangleIndexVertexArray:
Collaboration graph
[legend]

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btTriangleIndexVertexArray ()
 
virtual ~btTriangleIndexVertexArray ()
 
 btTriangleIndexVertexArray (int numTriangles, int *triangleIndexBase, int triangleIndexStride, int numVertices, btScalar *vertexBase, int vertexStride)
 
void addIndexedMesh (const btIndexedMesh &mesh, PHY_ScalarType indexType=PHY_INTEGER)
 
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)
 get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished More...
 
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
 
virtual void unLockVertexBase (int subpart)
 unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished More...
 
virtual void unLockReadOnlyVertexBase (int subpart) const
 
virtual int getNumSubParts () const
 getNumSubParts returns the number of separate subparts each subpart has a continuous array of vertices and indices More...
 
IndexedMeshArraygetIndexedMeshArray ()
 
const IndexedMeshArraygetIndexedMeshArray () const
 
virtual void preallocateVertices (int numverts)
 
virtual void preallocateIndices (int numindices)
 
virtual bool hasPremadeAabb () const
 
virtual void setPremadeAabb (const btVector3 &aabbMin, const btVector3 &aabbMax) const
 
virtual void getPremadeAabb (btVector3 *aabbMin, btVector3 *aabbMax) const
 
- Public Member Functions inherited from btStridingMeshInterface
 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btStridingMeshInterface ()
 
virtual ~btStridingMeshInterface ()
 
virtual void InternalProcessAllTriangles (btInternalTriangleIndexCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
 
void calculateAabbBruteForce (btVector3 &aabbMin, btVector3 &aabbMax)
 brute force method to calculate aabb More...
 
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
 get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished More...
 
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
 
virtual void unLockVertexBase (int subpart)=0
 unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished More...
 
virtual void unLockReadOnlyVertexBase (int subpart) const =0
 
virtual int getNumSubParts () const =0
 getNumSubParts returns the number of separate subparts each subpart has a continuous array of vertices and indices More...
 
virtual void preallocateVertices (int numverts)=0
 
virtual void preallocateIndices (int numindices)=0
 
virtual bool hasPremadeAabb () const
 
virtual void setPremadeAabb (const btVector3 &aabbMin, const btVector3 &aabbMax) const
 
virtual void getPremadeAabb (btVector3 *aabbMin, btVector3 *aabbMax) const
 
const btVector3getScaling () const
 
void setScaling (const btVector3 &scaling)
 
virtual int calculateSerializeBufferSize () const
 
virtual const char * serialize (void *dataBuffer, btSerializer *serializer) const
 fills the dataBuffer and returns the struct name (and 0 on failure) More...
 

Protected Attributes

IndexedMeshArray m_indexedMeshes
 
int m_pad [2]
 
int m_hasAabb
 
btVector3 m_aabbMin
 
btVector3 m_aabbMax
 
- Protected Attributes inherited from btStridingMeshInterface
btVector3 m_scaling
 

Detailed Description

The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing triangle/index arrays.

Additional meshes can be added using addIndexedMesh No duplicate is made of the vertex/index data, it only indexes into external vertex/index arrays. So keep those arrays around during the lifetime of this btTriangleIndexVertexArray.

Definition at line 65 of file btTriangleIndexVertexArray.h.

Constructor & Destructor Documentation

◆ btTriangleIndexVertexArray() [1/2]

btTriangleIndexVertexArray::btTriangleIndexVertexArray ( )
inline

Definition at line 78 of file btTriangleIndexVertexArray.h.

◆ ~btTriangleIndexVertexArray()

btTriangleIndexVertexArray::~btTriangleIndexVertexArray ( )
virtual

Definition at line 33 of file btTriangleIndexVertexArray.cpp.

◆ btTriangleIndexVertexArray() [2/2]

btTriangleIndexVertexArray::btTriangleIndexVertexArray ( int  numTriangles,
int *  triangleIndexBase,
int  triangleIndexStride,
int  numVertices,
btScalar vertexBase,
int  vertexStride 
)

Definition at line 18 of file btTriangleIndexVertexArray.cpp.

Member Function Documentation

◆ addIndexedMesh()

void btTriangleIndexVertexArray::addIndexedMesh ( const btIndexedMesh mesh,
PHY_ScalarType  indexType = PHY_INTEGER 
)
inline

Definition at line 87 of file btTriangleIndexVertexArray.h.

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btTriangleIndexVertexArray::BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ getIndexedMeshArray() [1/2]

IndexedMeshArray & btTriangleIndexVertexArray::getIndexedMeshArray ( )
inline

Definition at line 110 of file btTriangleIndexVertexArray.h.

◆ getIndexedMeshArray() [2/2]

const IndexedMeshArray & btTriangleIndexVertexArray::getIndexedMeshArray ( ) const
inline

Definition at line 115 of file btTriangleIndexVertexArray.h.

◆ getLockedReadOnlyVertexIndexBase()

void btTriangleIndexVertexArray::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
virtual

Implements btStridingMeshInterface.

Definition at line 57 of file btTriangleIndexVertexArray.cpp.

◆ getLockedVertexIndexBase()

void btTriangleIndexVertexArray::getLockedVertexIndexBase ( unsigned char **  vertexbase,
int &  numverts,
PHY_ScalarType type,
int &  stride,
unsigned char **  indexbase,
int &  indexstride,
int &  numfaces,
PHY_ScalarType indicestype,
int  subpart = 0 
)
virtual

get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished

Implements btStridingMeshInterface.

Definition at line 37 of file btTriangleIndexVertexArray.cpp.

◆ getNumSubParts()

virtual int btTriangleIndexVertexArray::getNumSubParts ( ) const
inlinevirtual

getNumSubParts returns the number of separate subparts each subpart has a continuous array of vertices and indices

Implements btStridingMeshInterface.

Definition at line 105 of file btTriangleIndexVertexArray.h.

◆ getPremadeAabb()

void btTriangleIndexVertexArray::getPremadeAabb ( btVector3 aabbMin,
btVector3 aabbMax 
) const
virtual

Reimplemented from btStridingMeshInterface.

Definition at line 86 of file btTriangleIndexVertexArray.cpp.

◆ hasPremadeAabb()

bool btTriangleIndexVertexArray::hasPremadeAabb ( ) const
virtual

Reimplemented from btStridingMeshInterface.

Definition at line 74 of file btTriangleIndexVertexArray.cpp.

◆ preallocateIndices()

virtual void btTriangleIndexVertexArray::preallocateIndices ( int  numindices)
inlinevirtual

Implements btStridingMeshInterface.

Reimplemented in btTriangleMesh.

Definition at line 121 of file btTriangleIndexVertexArray.h.

◆ preallocateVertices()

virtual void btTriangleIndexVertexArray::preallocateVertices ( int  numverts)
inlinevirtual

Implements btStridingMeshInterface.

Reimplemented in btTriangleMesh.

Definition at line 120 of file btTriangleIndexVertexArray.h.

◆ setPremadeAabb()

void btTriangleIndexVertexArray::setPremadeAabb ( const btVector3 aabbMin,
const btVector3 aabbMax 
) const
virtual

Reimplemented from btStridingMeshInterface.

Definition at line 79 of file btTriangleIndexVertexArray.cpp.

◆ unLockReadOnlyVertexBase()

virtual void btTriangleIndexVertexArray::unLockReadOnlyVertexBase ( int  subpart) const
inlinevirtual

Implements btStridingMeshInterface.

Definition at line 101 of file btTriangleIndexVertexArray.h.

◆ unLockVertexBase()

virtual void btTriangleIndexVertexArray::unLockVertexBase ( int  subpart)
inlinevirtual

unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished

Implements btStridingMeshInterface.

Definition at line 99 of file btTriangleIndexVertexArray.h.

Member Data Documentation

◆ m_aabbMax

btVector3 btTriangleIndexVertexArray::m_aabbMax
mutableprotected

Definition at line 73 of file btTriangleIndexVertexArray.h.

◆ m_aabbMin

btVector3 btTriangleIndexVertexArray::m_aabbMin
mutableprotected

Definition at line 72 of file btTriangleIndexVertexArray.h.

◆ m_hasAabb

int btTriangleIndexVertexArray::m_hasAabb
mutableprotected

Definition at line 71 of file btTriangleIndexVertexArray.h.

◆ m_indexedMeshes

IndexedMeshArray btTriangleIndexVertexArray::m_indexedMeshes
protected

Definition at line 69 of file btTriangleIndexVertexArray.h.

◆ m_pad

int btTriangleIndexVertexArray::m_pad[2]
protected

Definition at line 70 of file btTriangleIndexVertexArray.h.


The documentation for this class was generated from the following files: