btCollisionDispatcher * dispatcher = static_cast<btCollisionDispatcher *>(m_dynamicsWorld ->getDispatcher()); btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);
For example, you could create a trimesh from memory as following:
btTriangleIndexVertexArray* indexVertexArrays = new btTriangleIndexVertexArray(NUM_TRIANGLES, &gIndices[0][0], 3*sizeof(int), NUM_VERTICES,(REAL*) &gVertices[0],sizeof(REAL)*3);
Where gIndices is an array of integers and gVertices is an array of float with 3 components. Then you must create the Trimesh shape as following:
btGImpactMeshShape * trimesh = new btGImpactMeshShape(indexVertexArrays);
trimesh->setLocalScaling(btVector3(4.f,4.f,4.f));
trimesh->updateBound();// Call this method once before doing collisions
btGImpactCompoundShape * mycompound = new btGImpactCompoundShape(); btTransform localtransform; .... Setting transformation //add shapes with transformation btCollisionShape * subshape = creatingShape(0); mycompound->addChildShape(localtransform,subshape); .... Setting transformation btCollisionShape * subshape2 = creatingShape(1); mycompound->addChildShape(localtransform,subshape); .... add more shapes