| Bullet Collision Detection & Physics Library
    | 
 
 
 
Go to the documentation of this file.
   28           m_useQuantizedAabbCompression(useQuantizedAabbCompression),
 
   47           m_useQuantizedAabbCompression(useQuantizedAabbCompression),
 
  103                 virtual void processNode(
int nodeSubPart, 
int nodeTriangleIndex)
 
  106                         const unsigned char* vertexbase;
 
  110                         const unsigned char* indexbase;
 
  126                         unsigned int* gfxbase = (
unsigned int*)(indexbase + nodeTriangleIndex * indexstride);
 
  130                         for (
int j = 2; j >= 0; j--)
 
  132                                 int graphicsindex = indicestype == 
PHY_SHORT ? ((
unsigned short*)gfxbase)[j] : gfxbase[j];
 
  136                                         float* graphicsbase = (
float*)(vertexbase + graphicsindex * stride);
 
  138                                         m_triangle[j] = 
btVector3(graphicsbase[0] * meshScaling.
getX(), graphicsbase[1] * meshScaling.
getY(), graphicsbase[2] * meshScaling.
getZ());
 
  142                                         double* graphicsbase = (
double*)(vertexbase + graphicsindex * stride);
 
  149                         m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
 
  172                 virtual void processNode(
int nodeSubPart, 
int nodeTriangleIndex)
 
  175                         const unsigned char* vertexbase;
 
  179                         const unsigned char* indexbase;
 
  195                         unsigned int* gfxbase = (
unsigned int*)(indexbase + nodeTriangleIndex * indexstride);
 
  199                         for (
int j = 2; j >= 0; j--)
 
  201                                 int graphicsindex = indicestype == 
PHY_SHORT ? ((
unsigned short*)gfxbase)[j] : gfxbase[j];
 
  205                                         float* graphicsbase = (
float*)(vertexbase + graphicsindex * stride);
 
  207                                         m_triangle[j] = 
btVector3(graphicsbase[0] * meshScaling.
getX(), graphicsbase[1] * meshScaling.
getY(), graphicsbase[2] * meshScaling.
getZ());
 
  211                                         double* graphicsbase = (
double*)(vertexbase + graphicsindex * stride);
 
  218                         m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
 
  247                           m_callback(callback),
 
  252                 virtual void processNode(
int nodeSubPart, 
int nodeTriangleIndex)
 
  255                         const unsigned char* vertexbase;
 
  259                         const unsigned char* indexbase;
 
  275                         unsigned int* gfxbase = (
unsigned int*)(indexbase + nodeTriangleIndex * indexstride);
 
  279                         for (
int j = 2; j >= 0; j--)
 
  281                                 int graphicsindex = indicestype == 
PHY_SHORT ? ((
unsigned short*)gfxbase)[j] : indicestype == 
PHY_INTEGER ? gfxbase[j] : ((
unsigned char*)gfxbase)[j];
 
  283 #ifdef DEBUG_TRIANGLE_MESH 
  284                                 printf(
"%d ,", graphicsindex);
 
  285 #endif  //DEBUG_TRIANGLE_MESH 
  288                                         float* graphicsbase = (
float*)(vertexbase + graphicsindex * stride);
 
  291                                                 graphicsbase[0] * meshScaling.
getX(),
 
  292                                                 graphicsbase[1] * meshScaling.
getY(),
 
  293                                                 graphicsbase[2] * meshScaling.
getZ());
 
  297                                         double* graphicsbase = (
double*)(vertexbase + graphicsindex * stride);
 
  304 #ifdef DEBUG_TRIANGLE_MESH 
  305                                 printf(
"triangle vertices:%f,%f,%f\n", triangle[j].x(), triangle[j].y(), triangle[j].z());
 
  306 #endif  //DEBUG_TRIANGLE_MESH 
  309                         m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
 
  375 #ifdef BT_USE_DOUBLE_PRECISION 
  381 #endif  //BT_USE_DOUBLE_PRECISION 
  385 #ifdef BT_USE_DOUBLE_PRECISION 
  391 #endif  //BT_USE_DOUBLE_PRECISION 
  427         memset(trimeshData->
m_pad3, 0, 
sizeof(trimeshData->
m_pad3));
 
  429         return "btTriangleMeshShapeData";
 
  
void reportRayOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &raySource, const btVector3 &rayTarget) const
The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly...
#define btAlignedFree(ptr)
virtual void setLocalScaling(const btVector3 &scaling)
virtual int calculateSerializeBufferSize() const
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes,...
#define BT_TRIANLGE_INFO_MAP
btScalar m_collisionMargin
#define btQuantizedBvhData
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual const btVector3 & getLocalScaling() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
void performRaycast(btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget)
virtual void * getUniquePointer(void *oldPtr)=0
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
virtual void setLocalScaling(const btVector3 &scaling)
#define btAlignedAlloc(size, alignment)
btTriangleInfoMap * m_triangleInfoMap
btStridingMeshInterfaceData m_meshInterface
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
const btScalar & getX() const
Return the x value.
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
btTriangleInfoMapData * m_triangleInfoMap
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual void serializeSingleTriangleInfoMap(btSerializer *serializer) const
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.
void reportBoxCastOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &raySource, const btVector3 &rayTarget, const btVector3 &aabbMin, const btVector3 &aabbMax) const
virtual void serializeSingleBvh(btSerializer *serializer) const
void performConvexcast(btTriangleCallback *callback, const btVector3 &boxSource, const btVector3 &boxTarget, const btVector3 &boxMin, const btVector3 &boxMax)
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
#define BT_QUANTIZED_BVH_CODE
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization...
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
bool m_useQuantizedAabbCompression
btVector3 can be used to represent 3D points and vectors.
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
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 ~btOptimizedBvh()
void refitTree(const btVector3 &aabbMin, const btVector3 &aabbMax)
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
const btScalar & getZ() const
Return the z value.
const btVector3 & getScaling() const
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
const btScalar & getY() const
Return the y value.
btStridingMeshInterface * m_meshInterface
btQuantizedBvhFloatData * m_quantizedFloatBvh
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
void partialRefitTree(const btVector3 &aabbMin, const btVector3 &aabbMax)
for a fast incremental refit of parts of the tree. Note: the entire AABB of the tree will become more...
btCollisionShapeData m_collisionShapeData
virtual int calculateSerializeBufferSizeNew() const
void refitPartial(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
virtual ~btBvhTriangleMeshShape()
virtual void * findPointer(void *oldPtr)=0
void reportAabbOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
***************************************** expert/internal use only *************************
virtual int getSerializationFlags() const =0
virtual void unLockReadOnlyVertexBase(int subpart) const =0
virtual btChunk * allocate(size_t size, int numElements)=0