Blender  V3.3
Classes | Functions | Variables
btBvhTriangleMeshShape.h File Reference
#include "btTriangleMeshShape.h"
#include "btOptimizedBvh.h"
#include "LinearMath/btAlignedAllocator.h"
#include "btTriangleInfoMap.h"

Go to the source code of this file.

Classes

struct  btTriangleMeshShapeData
 do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 More...
 

Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btBvhTriangleMeshShape (btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, bool buildBvh=true)
 
 btBvhTriangleMeshShape (btStridingMeshInterface *meshInterface, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax, bool buildBvh=true)
 optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb More...
 
virtual ~btBvhTriangleMeshShape ()
 
bool getOwnsBvh () const
 
void performRaycast (btTriangleCallback *callback, const btVector3 &raySource, const btVector3 &rayTarget)
 
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
 
void refitTree (const btVector3 &aabbMin, const btVector3 &aabbMax)
 
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 conservative, it never shrinks More...
 
virtual const char * getName () const
 
virtual void setLocalScaling (const btVector3 &scaling)
 
btOptimizedBvhgetOptimizedBvh ()
 
void setOptimizedBvh (btOptimizedBvh *bvh, const btVector3 &localScaling=btVector3(1, 1, 1))
 
void buildOptimizedBvh ()
 
bool usesQuantizedAabbCompression () const
 
void setTriangleInfoMap (btTriangleInfoMap *triangleInfoMap)
 
const btTriangleInfoMapgetTriangleInfoMap () const
 
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...
 
virtual void serializeSingleBvh (btSerializer *serializer) const
 
virtual void serializeSingleTriangleInfoMap (btSerializer *serializer) const
 

Variables

btBvhTriangleMeshShape __pad0__
 
btTriangleInfoMapm_triangleInfoMap
 
bool m_useQuantizedAabbCompression
 
bool m_ownsBvh
 
bool m_pad [11]
 

Function Documentation

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ btBvhTriangleMeshShape() [1/2]

btBvhTriangleMeshShape::btBvhTriangleMeshShape ( btStridingMeshInterface meshInterface,
bool  useQuantizedAabbCompression,
bool  buildBvh = true 
)

Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. Uses an interface to access the triangles to allow for sharing graphics/physics triangles.

Definition at line 24 of file btBvhTriangleMeshShape.cpp.

References buildOptimizedBvh(), and TRIANGLE_MESH_SHAPE_PROXYTYPE.

Referenced by btAdjustInternalEdgeContacts(), btCollisionWorldImporter::convertAllObjects(), btCollisionWorldImporter::convertCollisionShape(), btCollisionWorldImporter::createBvhTriangleMeshShape(), btCollisionWorld::objectQuerySingleInternal(), btCollisionWorld::rayTestSingleInternal(), RB_shape_delete(), RB_shape_new_trimesh(), and RB_shape_trimesh_update().

◆ btBvhTriangleMeshShape() [2/2]

btBvhTriangleMeshShape::btBvhTriangleMeshShape ( btStridingMeshInterface meshInterface,
bool  useQuantizedAabbCompression,
const btVector3 bvhAabbMin,
const btVector3 bvhAabbMax,
bool  buildBvh = true 
)

optionally pass in a larger bvh aabb, used for quantization. This allows for deformations within this aabb

Definition at line 43 of file btBvhTriangleMeshShape.cpp.

References btAlignedAlloc, btOptimizedBvh(), m_ownsBvh, m_useQuantizedAabbCompression, and TRIANGLE_MESH_SHAPE_PROXYTYPE.

◆ buildOptimizedBvh()

void btBvhTriangleMeshShape::buildOptimizedBvh ( )

m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work

Definition at line 340 of file btBvhTriangleMeshShape.cpp.

References btAlignedAlloc, btAlignedFree, btOptimizedBvh(), m_localAabbMax, m_localAabbMin, m_meshInterface, m_ownsBvh, and m_useQuantizedAabbCompression.

Referenced by btBvhTriangleMeshShape().

◆ calculateSerializeBufferSize()

virtual int calculateSerializeBufferSize ( ) const
virtual

◆ getName()

virtual const char* getName ( ) const
virtual

Definition at line 74 of file btBvhTriangleMeshShape.h.

◆ getOptimizedBvh()

btOptimizedBvh* getOptimizedBvh ( )

Definition at line 78 of file btBvhTriangleMeshShape.h.

◆ getOwnsBvh()

bool getOwnsBvh ( ) const

Definition at line 58 of file btBvhTriangleMeshShape.h.

References m_ownsBvh.

◆ getTriangleInfoMap()

struct btTriangleInfoMap * getTriangleInfoMap ( ) const

Definition at line 97 of file btBvhTriangleMeshShape.h.

References m_triangleInfoMap.

◆ partialRefitTree()

void btBvhTriangleMeshShape::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 conservative, it never shrinks

Definition at line 66 of file btBvhTriangleMeshShape.cpp.

References m_localAabbMax, m_localAabbMin, and m_meshInterface.

◆ performConvexcast()

void btBvhTriangleMeshShape::performConvexcast ( btTriangleCallback callback,
const btVector3 boxSource,
const btVector3 boxTarget,
const btVector3 boxMin,
const btVector3 boxMax 
)

◆ performRaycast()

void btHeightfieldTerrainShape::performRaycast ( btTriangleCallback callback,
const btVector3 raySource,
const btVector3 rayTarget 
)

Performs a raycast using a hierarchical Bresenham algorithm. Does not allocate any memory by itself.

Definition at line 90 of file btBvhTriangleMeshShape.cpp.

References btAssert, btStridingMeshInterface, btVector3, callback, m_meshInterface, PHY_FLOAT, PHY_INTEGER, PHY_SHORT, PHY_UCHAR, btNodeOverlapCallback::processNode(), btTriangleCallback::processTriangle(), stride, and type.

◆ processAllTriangles()

virtual void processAllTriangles ( btTriangleCallback callback,
const btVector3 aabbMin,
const btVector3 aabbMax 
) const
virtual

Definition at line 57 of file btEmptyShape.h.

◆ refitTree()

void btBvhTriangleMeshShape::refitTree ( const btVector3 aabbMin,
const btVector3 aabbMax 
)

Definition at line 74 of file btBvhTriangleMeshShape.cpp.

References m_meshInterface, and recalcLocalAabb().

◆ serialize()

virtual const char* serialize ( void dataBuffer,
btSerializer serializer 
) const
virtual

fills the dataBuffer and returns the struct name (and 0 on failure)

◆ serializeSingleBvh()

void btBvhTriangleMeshShape::serializeSingleBvh ( btSerializer serializer) const
virtual

◆ serializeSingleTriangleInfoMap()

void btBvhTriangleMeshShape::serializeSingleTriangleInfoMap ( btSerializer serializer) const
virtual

◆ setLocalScaling()

virtual void setLocalScaling ( const btVector3 scaling)
virtual

Definition at line 120 of file btBox2dShape.h.

◆ setOptimizedBvh()

void btBvhTriangleMeshShape::setOptimizedBvh ( btOptimizedBvh bvh,
const btVector3 localScaling = btVector3(1, 1, 1) 
)

◆ setTriangleInfoMap()

void setTriangleInfoMap ( btTriangleInfoMap triangleInfoMap)

Definition at line 92 of file btBvhTriangleMeshShape.h.

References m_triangleInfoMap.

◆ usesQuantizedAabbCompression()

bool usesQuantizedAabbCompression ( ) const

Definition at line 87 of file btBvhTriangleMeshShape.h.

References m_useQuantizedAabbCompression.

◆ ~btBvhTriangleMeshShape()

btBvhTriangleMeshShape::~btBvhTriangleMeshShape ( )
virtual

Definition at line 81 of file btBvhTriangleMeshShape.cpp.

References btAlignedFree, and m_ownsBvh.

Variable Documentation

◆ __pad0__

The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving objects. If you required moving concave triangle meshes, it is recommended to perform convex decomposition using HACD, see Bullet/Demos/ConvexDecompositionDemo. Alternatively, you can use btGimpactMeshShape for moving concave triangle meshes. btBvhTriangleMeshShape has several optimizations, such as bounding volume hierarchy and cache friendly traversal for PlayStation 3 Cell SPU. It is recommended to enable useQuantizedAabbCompression for better memory usage. It takes a triangle mesh as input, for example a btTriangleMesh or btTriangleIndexVertexArray. The btBvhTriangleMeshShape class allows for triangle mesh deformations by a refit or partialRefit method. Instead of building the bounding volume hierarchy acceleration structure, it is also possible to serialize (save) and deserialize (load) the structure from disk. See Demos\ConcaveDemo\ConcavePhysicsDemo.cpp for an example.

Definition at line 35 of file btBvhTriangleMeshShape.h.

◆ m_ownsBvh

bool m_ownsBvh

◆ m_pad

bool m_pad[11]

Definition at line 45 of file btBvhTriangleMeshShape.h.

◆ m_triangleInfoMap

btTriangleInfoMap* m_triangleInfoMap

◆ m_useQuantizedAabbCompression

bool m_useQuantizedAabbCompression