Blender V2.61 - r43446
|
#include <btStridingMeshInterface.h>
Public Member Functions | |
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 | |
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 |
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 |
virtual void | unLockReadOnlyVertexBase (int subpart) const =0 |
virtual int | getNumSubParts () const =0 |
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 btVector3 & | getScaling () 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) | |
Protected Attributes | |
btVector3 | m_scaling |
The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes. Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips. It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
Definition at line 30 of file btStridingMeshInterface.h.
btStridingMeshInterface::btStridingMeshInterface | ( | ) | [inline] |
Definition at line 37 of file btStridingMeshInterface.h.
btStridingMeshInterface::~btStridingMeshInterface | ( | ) | [virtual] |
Definition at line 19 of file btStridingMeshInterface.cpp.
void btStridingMeshInterface::calculateAabbBruteForce | ( | btVector3 & | aabbMin, |
btVector3 & | aabbMax | ||
) |
brute force method to calculate aabb
Definition at line 176 of file btStridingMeshInterface.cpp.
References BT_LARGE_FLOAT, and InternalProcessAllTriangles().
SIMD_FORCE_INLINE int btStridingMeshInterface::calculateSerializeBufferSize | ( | ) | const [virtual] |
Definition at line 155 of file btStridingMeshInterface.h.
virtual void btStridingMeshInterface::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 [pure virtual] |
virtual void btStridingMeshInterface::getLockedVertexIndexBase | ( | unsigned char ** | vertexbase, |
int & | numverts, | ||
PHY_ScalarType & | type, | ||
int & | stride, | ||
unsigned char ** | indexbase, | ||
int & | indexstride, | ||
int & | numfaces, | ||
PHY_ScalarType & | indicestype, | ||
int | subpart = 0 |
||
) | [pure 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
virtual int btStridingMeshInterface::getNumSubParts | ( | ) | const [pure virtual] |
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices
Referenced by ATTRIBUTE_ALIGNED16(), btGenerateInternalEdgeInfo(), btGImpactMeshShape::buildMeshParts(), InternalProcessAllTriangles(), and serialize().
virtual void btStridingMeshInterface::getPremadeAabb | ( | btVector3 * | aabbMin, |
btVector3 * | aabbMax | ||
) | const [inline, virtual] |
Definition at line 80 of file btStridingMeshInterface.h.
Referenced by btTriangleMeshShape::btTriangleMeshShape().
const btVector3& btStridingMeshInterface::getScaling | ( | ) | const [inline] |
Definition at line 86 of file btStridingMeshInterface.h.
References m_scaling.
Referenced by btGenerateInternalEdgeInfo(), btTriangleMeshShape::getLocalScaling(), btConvexTriangleMeshShape::getLocalScaling(), InternalProcessAllTriangles(), serialize(), and btGImpactMeshShapePart::TrimeshPrimitiveManager::TrimeshPrimitiveManager().
virtual bool btStridingMeshInterface::hasPremadeAabb | ( | ) | const [inline, virtual] |
Definition at line 74 of file btStridingMeshInterface.h.
Referenced by btTriangleMeshShape::btTriangleMeshShape().
void btStridingMeshInterface::InternalProcessAllTriangles | ( | btInternalTriangleIndexCallback * | callback, |
const btVector3 & | aabbMin, | ||
const btVector3 & | aabbMax | ||
) | const [virtual] |
if the number of parts is big, the performance might drop due to the innerloop switch on indextype
unlike that developers want to pass in double-precision meshes in single-precision Bullet build so disable this feature by default see patch http://code.google.com/p/bullet/issues/detail?id=213
Definition at line 25 of file btStridingMeshInterface.cpp.
References btAssert, getLockedReadOnlyVertexIndexBase(), getNumSubParts(), getScaling(), btInternalTriangleIndexCallback::internalProcessTriangleIndex(), PHY_DOUBLE, PHY_FLOAT, PHY_INTEGER, PHY_SHORT, PHY_UCHAR, and unLockReadOnlyVertexBase().
Referenced by btConvexTriangleMeshShape::batchedUnitVectorGetSupportingVertexWithoutMargin(), calculateAabbBruteForce(), btConvexTriangleMeshShape::calculatePrincipalAxisTransform(), btCollisionWorld::debugDrawObject(), btConvexTriangleMeshShape::localGetSupportingVertexWithoutMargin(), and btTriangleMeshShape::processAllTriangles().
virtual void btStridingMeshInterface::preallocateIndices | ( | int | numindices | ) | [pure virtual] |
virtual void btStridingMeshInterface::preallocateVertices | ( | int | numverts | ) | [pure virtual] |
const char * btStridingMeshInterface::serialize | ( | void * | dataBuffer, |
btSerializer * | serializer | ||
) | const [virtual] |
fills the dataBuffer and returns the struct name (and 0 on failure)
if the number of parts is big, the performance might drop due to the innerloop switch on indextype
Definition at line 217 of file btStridingMeshInterface.cpp.
References btSerializer::allocate(), BT_ARRAY_CODE, btAssert, btSerializer::finalizeChunk(), getLockedReadOnlyVertexIndexBase(), getNumSubParts(), getScaling(), btSerializer::getUniquePointer(), i, btMeshPartData::m_3indices16, btMeshPartData::m_3indices8, btVector3DoubleData::m_floats, btVector3FloatData::m_floats, btMeshPartData::m_indices16, btMeshPartData::m_indices32, btStridingMeshInterfaceData::m_meshPartsPtr, btStridingMeshInterfaceData::m_numMeshParts, btMeshPartData::m_numTriangles, btMeshPartData::m_numVertices, btChunk::m_oldPtr, m_scaling, btStridingMeshInterfaceData::m_scaling, btIntIndexData::m_value, btCharIndexTripletData::m_values, btShortIntIndexTripletData::m_values, btMeshPartData::m_vertices3d, btMeshPartData::m_vertices3f, PHY_DOUBLE, PHY_FLOAT, PHY_INTEGER, PHY_SHORT, PHY_UCHAR, and unLockReadOnlyVertexBase().
Referenced by ATTRIBUTE_ALIGNED16(), and btGImpactMeshShape::serialize().
virtual void btStridingMeshInterface::setPremadeAabb | ( | const btVector3 & | aabbMin, |
const btVector3 & | aabbMax | ||
) | const [inline, virtual] |
Definition at line 75 of file btStridingMeshInterface.h.
void btStridingMeshInterface::setScaling | ( | const btVector3 & | scaling | ) | [inline] |
Definition at line 89 of file btStridingMeshInterface.h.
References m_scaling.
Referenced by btConvexTriangleMeshShape::setLocalScaling(), and btTriangleMeshShape::setLocalScaling().
virtual void btStridingMeshInterface::unLockReadOnlyVertexBase | ( | int | subpart | ) | const [pure virtual] |
virtual void btStridingMeshInterface::unLockVertexBase | ( | int | subpart | ) | [pure virtual] |
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
btVector3 btStridingMeshInterface::m_scaling [protected] |
Definition at line 34 of file btStridingMeshInterface.h.
Referenced by getScaling(), serialize(), and setScaling().