cleanup memory in CcdPhysicsDemo, RagdollDemo, ConcaveDemo, BspDemo (work in progress)

This commit is contained in:
ejcoumans
2007-11-01 05:50:50 +00:00
parent a146bbc293
commit f3424f491c
11 changed files with 479 additions and 107 deletions

View File

@@ -16,12 +16,35 @@ subject to the following restrictions:
#define CONCAVE_DEMO_H
#include "DemoApplication.h"
#include "LinearMath/btAlignedObjectArray.h"
class btBroadphaseInterface;
class btCollisionShape;
class btOverlappingPairCache;
class btCollisionDispatcher;
class btConstraintSolver;
struct btCollisionAlgorithmCreateFunc;
class btDefaultCollisionConfiguration;
class btTriangleIndexVertexArray;
///ConcaveDemo shows usage of static concave triangle meshes
///It also shows per-triangle material (friction/restitution) through CustomMaterialCombinerCallback
class ConcaveDemo : public DemoApplication
{
//keep the collision shapes, for deletion/cleanup
btAlignedObjectArray<btCollisionShape*> m_collisionShapes;
btTriangleIndexVertexArray* m_indexVertexArrays;
btBroadphaseInterface* m_broadphase;
btCollisionDispatcher* m_dispatcher;
btConstraintSolver* m_solver;
btDefaultCollisionConfiguration* m_collisionConfiguration;
bool m_animatedMesh;
public:
@@ -32,6 +55,13 @@ class ConcaveDemo : public DemoApplication
}
void initPhysics();
void exitPhysics();
virtual ~ConcaveDemo()
{
exitPhysics();
}
virtual void clientMoveAndDisplay();
virtual void displayCallback();