From 91de258030efb1400fb244817757a32b8d1f99e2 Mon Sep 17 00:00:00 2001 From: Jasper Date: Fri, 28 Nov 2014 17:01:56 +0100 Subject: [PATCH] Reduced memory usage of trianglemesh --- physics.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/physics.cc b/physics.cc index 0da8d65..7fd76b2 100644 --- a/physics.cc +++ b/physics.cc @@ -159,11 +159,12 @@ void Physics::addTriangleMeshBody(Entity entity, float mass, float dampningL, fl { btTriangleMesh* trimesh = new btTriangleMesh(); - btVector3* v0 = new btVector3( 0, 0, 0); - btVector3* v1 = new btVector3( 1, 1, 1); - btVector3* v2 = new btVector3( 2, 2, 2); - trimesh->addTriangle( *v0, *v1, *v2 ); + btVector3 v0( 0, 0, 0 ); + btVector3 v1( 1, 1, 1 ); + btVector3 v2( 2, 2, 2); + + trimesh->addTriangle( v0, v1, v2 ); btTriangleMeshShape* shape = new btBvhTriangleMeshShape(trimesh,true); btVector3 inertia(0,0,0);