free memory for btShapeHulls, keep track of it in GL_ShapeDrawer.
move btShapeHull and btConvexHull into its own library in Extras/ConvexHull (it allocates memory using mem/delete and refactoring into using btAlignedAlloc/Free takes too much time) fix heightfield / btOptimizedBvh for quantization, so that raycast can use quantized aabb (clamp up for maxima and down for minima) work-in-progress (update projectfiles etc)
This commit is contained in:
@@ -16,16 +16,26 @@ subject to the following restrictions:
|
||||
#define GL_SHAPE_DRAWER_H
|
||||
|
||||
class btCollisionShape;
|
||||
class btShapeHull;
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
/// OpenGL shape drawing
|
||||
class GL_ShapeDrawer
|
||||
{
|
||||
public:
|
||||
//clean-up memory of dynamically created shape hulls
|
||||
btAlignedObjectArray<btShapeHull*> m_shapeHulls;
|
||||
|
||||
static void drawOpenGL(btScalar* m, const btCollisionShape* shape, const btVector3& color,int debugMode);
|
||||
static void drawCoordSystem();
|
||||
public:
|
||||
GL_ShapeDrawer();
|
||||
|
||||
virtual ~GL_ShapeDrawer();
|
||||
|
||||
///drawOpenGL might allocate temporary memoty, stores pointer in shape userpointer
|
||||
void drawOpenGL(btScalar* m, const btCollisionShape* shape, const btVector3& color,int debugMode);
|
||||
|
||||
static void drawCylinder(float radius,float halfHeight, int upAxis);
|
||||
static void drawCoordSystem();
|
||||
};
|
||||
|
||||
void OGL_displaylist_register_shape(btCollisionShape * shape);
|
||||
|
||||
Reference in New Issue
Block a user