Implementation of virtual void CommonRenderInterface::removeGraphicsInstance(int instanceUid)
for GLInstancingRenderer (OpenGL3+) and SimpleOpenGL2Renderer (OpenGL2) Refactored the add/remove object pool in Bullet3Common/b3ResizablePool.h Added CommonRigidBodyBase::deleteRigidBody, also removing its graphics instance.
This commit is contained in:
@@ -410,6 +410,18 @@ struct CommonRigidBodyBase : public CommonExampleInterface
|
||||
return box;
|
||||
}
|
||||
|
||||
void deleteRigidBody(btRigidBody* body)
|
||||
{
|
||||
int graphicsUid = body->getUserIndex();
|
||||
m_guiHelper->removeGraphicsInstance(graphicsUid);
|
||||
|
||||
m_dynamicsWorld->removeRigidBody(body);
|
||||
btMotionState* ms = body->getMotionState();
|
||||
delete body;
|
||||
delete ms;
|
||||
|
||||
}
|
||||
|
||||
btRigidBody* createRigidBody(float mass, const btTransform& startTransform, btCollisionShape* shape, const btVector4& color = btVector4(1, 0, 0, 1))
|
||||
{
|
||||
btAssert((!shape || shape->getShapeType() != INVALID_SHAPE_PROXYTYPE));
|
||||
|
||||
Reference in New Issue
Block a user