Apple contribution for OSX SSE and iOS NEON optimizations unit tests, thanks to Jordan Hubbard, Ian Ollmann and Hristo Hristov.

For OSX:
cd build
./premake_osx xcode4
for iOS:
cd build
./ios_build.sh
./ios_run.sh

Also integrated the branches/StackAllocation to make it easier to multi-thread collision detection in the near future. It avoids changing the btCollisionObject while performing collision detection.

As this is a large patch, some stuff might be temporarily broken, I'll keep an eye out on issues.
This commit is contained in:
erwin.coumans
2012-06-07 00:56:30 +00:00
parent 777b92a2ad
commit 73b217fb07
323 changed files with 30730 additions and 13635 deletions

View File

@@ -1252,21 +1252,24 @@ void BenchmarkDemo::exitPhysics()
RagDoll* doll = m_ragdolls[i];
delete doll;
}
m_ragdolls.clear();
//cleanup in the reverse order of creation/initialization
//remove the rigidbodies from the dynamics world and delete them
for (i=m_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
{
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
btRigidBody* body = btRigidBody::upcast(obj);
if (body && body->getMotionState())
{
delete body->getMotionState();
}
m_dynamicsWorld->removeCollisionObject( obj );
delete obj;
}
if (m_dynamicsWorld)
{
//remove the rigidbodies from the dynamics world and delete them
for (i=m_dynamicsWorld->getNumCollisionObjects()-1; i>=0 ;i--)
{
btCollisionObject* obj = m_dynamicsWorld->getCollisionObjectArray()[i];
btRigidBody* body = btRigidBody::upcast(obj);
if (body && body->getMotionState())
{
delete body->getMotionState();
}
m_dynamicsWorld->removeCollisionObject( obj );
delete obj;
}
}
//delete collision shapes
for (int j=0;j<m_collisionShapes.size();j++)
@@ -1274,20 +1277,26 @@ void BenchmarkDemo::exitPhysics()
btCollisionShape* shape = m_collisionShapes[j];
delete shape;
}
m_collisionShapes.clear();
//delete dynamics world
delete m_dynamicsWorld;
m_dynamicsWorld=0;
//delete solver
delete m_solver;
m_solver=0;
//delete broadphase
delete m_overlappingPairCache;
m_overlappingPairCache=0;
//delete dispatcher
delete m_dispatcher;
m_dispatcher=0;
delete m_collisionConfiguration;
m_collisionConfiguration=0;
}

View File

@@ -27,7 +27,7 @@ IF (USE_GLUT)
main.cpp
BenchmarkDemo.cpp
BenchmarkDemo.h
${BULLET_PHYSICS_SOURCE_DIR}/msvc/bullet.rc
${BULLET_PHYSICS_SOURCE_DIR}/build/bullet.rc
)
ELSE()
ADD_EXECUTABLE(AppBenchmarks
@@ -83,7 +83,7 @@ ELSE (USE_GLUT)
BenchmarkDemo.cpp
BenchmarkDemo.h
Win32BenchmarkDemo.cpp
${BULLET_PHYSICS_SOURCE_DIR}/msvc/bullet.rc
${BULLET_PHYSICS_SOURCE_DIR}/build/bullet.rc
)
ENDIF (USE_GLUT)
ELSE (USE_GRAPHICAL_BENCHMARK)

View File

@@ -22,12 +22,12 @@ subject to the following restrictions:
#include "GlutStuff.h"
#include "GLDebugDrawer.h"
GLDebugDrawer gDebugDrawer;
#define benchmarkDemo benchmarkDemo4
#define benchmarkDemo benchmarkDemo2
#endif //USE_GRAPHICAL_BENCHMARK
#define NUM_DEMOS 7
#define NUM_TESTS 650
#define NUM_TESTS 200
extern bool gDisableDeactivation;
@@ -75,6 +75,7 @@ int main(int argc,char** argv)
}
demoArray[d]->exitPhysics();
}
for (d=0;d<NUM_DEMOS;d++)

View File

@@ -0,0 +1,22 @@
project "AppBenchmarks"
if _OPTIONS["ios"] then
kind "WindowedApp"
else
kind "ConsoleApp"
end
includedirs {"../../src"}
links {
"BulletDynamics","BulletCollision", "LinearMath"
}
language "C++"
files {
"**.cpp",
"**.h",
}