Bullet Collision Detection & Physics Library: btStridingMeshInterface Class Reference

Bullet Collision Detection & Physics Library

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
btStridingMeshInterface Class Referenceabstract

The btStridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with btBvhTriangleMeshShape and some other collision shapes. More...

`#include <btStridingMeshInterface.h>`

Inheritance diagram for btStridingMeshInterface:
[legend]
Collaboration diagram for btStridingMeshInterface:
[legend]

## Public Member Functions
| BT_DECLARE_ALIGNED_ALLOCATOR ()
| 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
| 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 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
| 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
virtual void | unLockReadOnlyVertexBase (int subpart) const =0
virtual int | getNumSubParts () const =0
| getNumSubParts returns the number of separate subparts each subpart has a continuous array of vertices and indices
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

## Detailed Description

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 26 of file btStridingMeshInterface.h.

## Constructor & Destructor Documentation

## ◆ btStridingMeshInterface()

btStridingMeshInterface::btStridingMeshInterface | ( |  | ) |
| inline

Definition at line 35 of file btStridingMeshInterface.h.

## ◆ ~btStridingMeshInterface()

btStridingMeshInterface::~btStridingMeshInterface | ( |  | ) |
| virtual

Definition at line 19 of file btStridingMeshInterface.cpp.

## Member Function Documentation

## ◆ BT_DECLARE_ALIGNED_ALLOCATOR()

btStridingMeshInterface::BT_DECLARE_ALIGNED_ALLOCATOR | ( |  | ) |

## ◆ calculateAabbBruteForce()

void btStridingMeshInterface::calculateAabbBruteForce | ( | btVector3 & | aabbMin,
|  | btVector3 & | aabbMax )

brute force method to calculate aabb

Definition at line 173 of file btStridingMeshInterface.cpp.

## ◆ calculateSerializeBufferSize()

int btStridingMeshInterface::calculateSerializeBufferSize | ( |  | ) | const
| inlinevirtual

Definition at line 148 of file btStridingMeshInterface.h.

## ◆ getLockedReadOnlyVertexIndexBase()

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

Implemented in btTriangleIndexVertexArray.

## ◆ getLockedVertexIndexBase()

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

Implemented in btTriangleIndexVertexArray.

## ◆ getNumSubParts()

virtual int btStridingMeshInterface::getNumSubParts | ( |  | ) | const
| pure virtual

getNumSubParts returns the number of separate subparts each subpart has a continuous array of vertices and indices

Implemented in btTriangleIndexVertexArray.

## ◆ getPremadeAabb()

virtual void btStridingMeshInterface::getPremadeAabb | ( | btVector3 * | aabbMin,
|  | btVector3 * | aabbMax ) const
| inlinevirtual

Reimplemented in btTriangleIndexVertexArray.

Definition at line 74 of file btStridingMeshInterface.h.

## ◆ getScaling()

const btVector3 & btStridingMeshInterface::getScaling | ( |  | ) | const
| inline

Definition at line 80 of file btStridingMeshInterface.h.

## ◆ hasPremadeAabb()

virtual bool btStridingMeshInterface::hasPremadeAabb | ( |  | ) | const
| inlinevirtual

Reimplemented in btTriangleIndexVertexArray.

Definition at line 68 of file btStridingMeshInterface.h.

## ◆ InternalProcessAllTriangles()

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 23 of file btStridingMeshInterface.cpp.

## ◆ preallocateIndices()

virtual void btStridingMeshInterface::preallocateIndices | ( | int | numindices | ) |
| pure virtual

Implemented in btTriangleIndexVertexArray, and btTriangleMesh.

## ◆ preallocateVertices()

virtual void btStridingMeshInterface::preallocateVertices | ( | int | numverts | ) |
| pure virtual

Implemented in btTriangleIndexVertexArray, and btTriangleMesh.

## ◆ serialize()

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 211 of file btStridingMeshInterface.cpp.

## ◆ setPremadeAabb()

virtual void btStridingMeshInterface::setPremadeAabb | ( | const btVector3 & | aabbMin,
|  | const btVector3 & | aabbMax ) const
| inlinevirtual

Reimplemented in btTriangleIndexVertexArray.

Definition at line 69 of file btStridingMeshInterface.h.

## ◆ setScaling()

void btStridingMeshInterface::setScaling | ( | const btVector3 & | scaling | ) |
| inline

Definition at line 84 of file btStridingMeshInterface.h.

## ◆ unLockReadOnlyVertexBase()

virtual void btStridingMeshInterface::unLockReadOnlyVertexBase | ( | int | subpart | ) | const
| pure virtual

Implemented in btTriangleIndexVertexArray.

## ◆ unLockVertexBase()

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

Implemented in btTriangleIndexVertexArray.

## Member Data Documentation

## ◆ m_scaling

btVector3 btStridingMeshInterface::m_scaling
| protected

Definition at line 30 of file btStridingMeshInterface.h.

The documentation for this class was generated from the following files:

- btStridingMeshInterface.h
- btStridingMeshInterface.cpp