85 m_bvh->~btOptimizedBvh();
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);
129 for (
int j = 2; j >= 0; j--)
132 switch (indicestype) {
133 case PHY_INTEGER: graphicsindex = gfxbase[j];
break;
134 case PHY_SHORT: graphicsindex = ((
unsigned short*)gfxbase)[j];
break;
135 case PHY_UCHAR: graphicsindex = ((
unsigned char*)gfxbase)[j];
break;
141 float* graphicsbase = (
float*)(vertexbase + graphicsindex *
stride);
143 m_triangle[j] =
btVector3(graphicsbase[0] * meshScaling.getX(), graphicsbase[1] * meshScaling.getY(), graphicsbase[2] * meshScaling.getZ());
147 double* graphicsbase = (
double*)(vertexbase + graphicsindex *
stride);
149 m_triangle[j] =
btVector3(
btScalar(graphicsbase[0]) * meshScaling.getX(),
btScalar(graphicsbase[1]) * meshScaling.getY(),
btScalar(graphicsbase[2]) * meshScaling.getZ());
154 m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
161 m_bvh->reportRayOverlappingNodex(&myNodeCallback, raySource, rayTarget);
177 virtual void processNode(
int nodeSubPart,
int nodeTriangleIndex)
180 const unsigned char* vertexbase;
184 const unsigned char* indexbase;
200 unsigned int* gfxbase = (
unsigned int*)(indexbase + nodeTriangleIndex * indexstride);
203 for (
int j = 2; j >= 0; j--)
206 switch (indicestype) {
207 case PHY_INTEGER: graphicsindex = gfxbase[j];
break;
208 case PHY_SHORT: graphicsindex = ((
unsigned short*)gfxbase)[j];
break;
209 case PHY_UCHAR: graphicsindex = ((
unsigned char*)gfxbase)[j];
break;
215 float* graphicsbase = (
float*)(vertexbase + graphicsindex *
stride);
217 m_triangle[j] =
btVector3(graphicsbase[0] * meshScaling.getX(), graphicsbase[1] * meshScaling.getY(), graphicsbase[2] * meshScaling.getZ());
221 double* graphicsbase = (
double*)(vertexbase + graphicsindex *
stride);
223 m_triangle[j] =
btVector3(
btScalar(graphicsbase[0]) * meshScaling.getX(),
btScalar(graphicsbase[1]) * meshScaling.getY(),
btScalar(graphicsbase[2]) * meshScaling.getZ());
228 m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
235 m_bvh->reportBoxCastOverlappingNodex(&myNodeCallback, raySource, rayTarget, aabbMin, aabbMax);
262 virtual void processNode(
int nodeSubPart,
int nodeTriangleIndex)
265 const unsigned char* vertexbase;
269 const unsigned char* indexbase;
285 unsigned int* gfxbase = (
unsigned int*)(indexbase + nodeTriangleIndex * indexstride);
289 for (
int j = 2; j >= 0; j--)
291 int graphicsindex = indicestype ==
PHY_SHORT ? ((
unsigned short*)gfxbase)[j] : indicestype ==
PHY_INTEGER ? gfxbase[j] : ((
unsigned char*)gfxbase)[j];
293 #ifdef DEBUG_TRIANGLE_MESH
294 printf(
"%d ,", graphicsindex);
298 float* graphicsbase = (
float*)(vertexbase + graphicsindex *
stride);
301 graphicsbase[0] * meshScaling.getX(),
302 graphicsbase[1] * meshScaling.getY(),
303 graphicsbase[2] * meshScaling.getZ());
307 double* graphicsbase = (
double*)(vertexbase + graphicsindex *
stride);
310 btScalar(graphicsbase[0]) * meshScaling.getX(),
311 btScalar(graphicsbase[1]) * meshScaling.getY(),
312 btScalar(graphicsbase[2]) * meshScaling.getZ());
314 #ifdef DEBUG_TRIANGLE_MESH
315 printf(
"triangle vertices:%f,%f,%f\n", triangle[j].
x(), triangle[j].
y(), triangle[j].
z());
319 m_callback->
processTriangle(m_triangle, nodeSubPart, nodeTriangleIndex);
326 m_bvh->reportAabbOverlappingNodex(&myNodeCallback, aabbMin, aabbMax);
344 m_bvh->~btOptimizedBvh();
385 #ifdef BT_USE_DOUBLE_PRECISION
395 #ifdef BT_USE_DOUBLE_PRECISION
403 int sz = m_bvh->calculateSerializeBufferSizeNew();
405 const char* structType = m_bvh->serialize(chunk->
m_oldPtr, serializer);
437 memset(trimeshData->
m_pad3, 0,
sizeof(trimeshData->
m_pad3));
439 return "btTriangleMeshShapeData";
446 int len = m_bvh->calculateSerializeBufferSizeNew();
448 const char* structType = m_bvh->serialize(chunk->
m_oldPtr, serializer);
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
#define btAlignedFree(ptr)
#define btAlignedAlloc(size, alignment)
virtual void setLocalScaling(const btVector3 &scaling)
in case we receive negative scaling
@ TRIANGLE_MESH_SHAPE_PROXYTYPE
virtual void serializeSingleBvh(btSerializer *serializer) const
void refitTree(const btVector3 &aabbMin, const btVector3 &aabbMax)
virtual ~btBvhTriangleMeshShape()
void setOptimizedBvh(btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
void performRaycast(btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget)
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...
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
virtual void serializeSingleTriangleInfoMap(btSerializer *serializer) const
btTriangleInfoMap * m_triangleInfoMap
bool m_useQuantizedAabbCompression
btBvhTriangleMeshShape(btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
virtual const btVector3 & getLocalScaling() const =0
btScalar m_collisionMargin
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
#define btQuantizedBvhData
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
@ BT_SERIALIZE_NO_TRIANGLEINFOMAP
#define BT_TRIANLGE_INFO_MAP
#define BT_QUANTIZED_BVH_CODE
btStridingMeshInterface * m_meshInterface
btTriangleMeshShape(btStridingMeshInterface *meshInterface)
SIMD_FORCE_INLINE btScalar length2() const
Return the length of the vector squared.
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
virtual void processNode(int subPart, int triangleIndex)=0
virtual btChunk * allocate(size_t size, int numElements)=0
virtual int getSerializationFlags() const =0
virtual void * findPointer(void *oldPtr)=0
virtual void * getUniquePointer(void *oldPtr)=0
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
virtual void processTriangle(btVector3 *triangle, int partId, int triangleIndex)=0
DEGForeachIDComponentCallback callback
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
do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
btStridingMeshInterfaceData m_meshInterface
btQuantizedBvhDoubleData * m_quantizedDoubleBvh
btQuantizedBvhFloatData * m_quantizedFloatBvh
btCollisionShapeData m_collisionShapeData
btTriangleInfoMapData * m_triangleInfoMap