28 m_useQuantizedAabbCompression(useQuantizedAabbCompression),
106 virtual void processNode(
int nodeSubPart,
int nodeTriangleIndex)
109 const unsigned char *vertexbase;
113 const unsigned char *indexbase;
129 unsigned int* gfxbase = (
unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
133 for (
int j=2;j>=0;j--)
135 int graphicsindex = indicestype==
PHY_SHORT?((
unsigned short*)gfxbase)[j]:gfxbase[j];
139 float* graphicsbase = (
float*)(vertexbase+graphicsindex*stride);
141 m_triangle[j] =
btVector3(graphicsbase[0]*meshScaling.
getX(),graphicsbase[1]*meshScaling.
getY(),graphicsbase[2]*meshScaling.
getZ());
145 double* graphicsbase = (
double*)(vertexbase+graphicsindex*stride);
175 virtual void processNode(
int nodeSubPart,
int nodeTriangleIndex)
178 const unsigned char *vertexbase;
182 const unsigned char *indexbase;
198 unsigned int* gfxbase = (
unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
202 for (
int j=2;j>=0;j--)
204 int graphicsindex = indicestype==
PHY_SHORT?((
unsigned short*)gfxbase)[j]:gfxbase[j];
208 float* graphicsbase = (
float*)(vertexbase+graphicsindex*stride);
210 m_triangle[j] =
btVector3(graphicsbase[0]*meshScaling.
getX(),graphicsbase[1]*meshScaling.
getY(),graphicsbase[2]*meshScaling.
getZ());
214 double* graphicsbase = (
double*)(vertexbase+graphicsindex*stride);
252 m_callback(callback),
257 virtual void processNode(
int nodeSubPart,
int nodeTriangleIndex)
260 const unsigned char *vertexbase;
264 const unsigned char *indexbase;
281 unsigned int* gfxbase = (
unsigned int*)(indexbase+nodeTriangleIndex*indexstride);
285 for (
int j=2;j>=0;j--)
288 int graphicsindex = indicestype==
PHY_SHORT?((
unsigned short*)gfxbase)[j]:indicestype==
PHY_INTEGER?gfxbase[j]:((
unsigned char*)gfxbase)[j];
291 #ifdef DEBUG_TRIANGLE_MESH 292 printf(
"%d ,",graphicsindex);
293 #endif //DEBUG_TRIANGLE_MESH 296 float* graphicsbase = (
float*)(vertexbase+graphicsindex*stride);
299 graphicsbase[0]*meshScaling.
getX(),
300 graphicsbase[1]*meshScaling.
getY(),
301 graphicsbase[2]*meshScaling.
getZ());
305 double* graphicsbase = (
double*)(vertexbase+graphicsindex*stride);
312 #ifdef DEBUG_TRIANGLE_MESH 313 printf(
"triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z());
314 #endif //DEBUG_TRIANGLE_MESH 390 #ifdef BT_USE_DOUBLE_PRECISION 396 #endif //BT_USE_DOUBLE_PRECISION 400 #ifdef BT_USE_DOUBLE_PRECISION 406 #endif //BT_USE_DOUBLE_PRECISION 441 memset(trimeshData->
m_pad3, 0,
sizeof(trimeshData->
m_pad3));
443 return "btTriangleMeshShapeData";
void reportAabbOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
***************************************** expert/internal use only ************************* ...
void performRaycast(btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget)
btCollisionShapeData m_collisionShapeData
btStridingMeshInterface * m_meshInterface
#define BT_QUANTIZED_BVH_CODE
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
virtual void * getUniquePointer(void *oldPtr)=0
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
btScalar m_collisionMargin
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.
btStridingMeshInterfaceData m_meshInterface
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
btTriangleInfoMapData * m_triangleInfoMap
The btTriangleMeshShape is an internal concave triangle mesh interface. Don't use this class directly...
const btScalar & getZ() const
Return the z value.
virtual void setLocalScaling(const btVector3 &scaling)
void reportBoxCastOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &raySource, const btVector3 &rayTarget, const btVector3 &aabbMin, const btVector3 &aabbMax) const
virtual void serializeSingleBvh(btSerializer *serializer) const
virtual int getSerializationFlags() const =0
virtual const btVector3 & getLocalScaling() const
btTriangleInfoMap * m_triangleInfoMap
The btTriangleCallback provides a callback for each overlapping triangle when calling processAllTrian...
virtual int calculateSerializeBufferSizeNew() const
#define btAlignedFree(ptr)
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
virtual void setLocalScaling(const btVector3 &scaling)
void performConvexcast(btTriangleCallback *callback, const btVector3 &boxSource, const btVector3 &boxTarget, const btVector3 &boxMin, const btVector3 &boxMax)
void reportRayOverlappingNodex(btNodeOverlapCallback *nodeCallback, const btVector3 &raySource, const btVector3 &rayTarget) const
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 serializeSingleTriangleInfoMap(btSerializer *serializer) const
btVector3 can be used to represent 3D points and vectors.
bool m_useQuantizedAabbCompression
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
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...
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
The btStridingMeshInterface is the interface class for high performance generic access to triangle me...
virtual void processAllTriangles(btTriangleCallback *callback, const btVector3 &aabbMin, const btVector3 &aabbMax) const
const btVector3 & getScaling() const
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 ...
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 ~btBvhTriangleMeshShape()
void refitTree(const btVector3 &aabbMin, const btVector3 &aabbMax)
#define btAlignedAlloc(size, alignment)
btQuantizedBvhFloatData * m_quantizedFloatBvh
#define BT_TRIANLGE_INFO_MAP
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
virtual void unLockReadOnlyVertexBase(int subpart) const =0
void setMax(const btVector3 &other)
Set each element to the max of the current values and the values of another btVector3.
virtual void * findPointer(void *oldPtr)=0
virtual const char * serialize(void *dataBuffer, btSerializer *serializer) const
fills the dataBuffer and returns the struct name (and 0 on failure)
virtual int calculateSerializeBufferSize() const
virtual btChunk * allocate(size_t size, int numElements)=0
virtual ~btOptimizedBvh()
const btScalar & getX() const
Return the x value.
void setMin(const btVector3 &other)
Set each element to the min of the current values and the values of another btVector3.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define btQuantizedBvhData
PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.
void refitPartial(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)