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:
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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++)
|
||||
|
||||
22
Demos/Benchmarks/premake4.lua
Normal file
22
Demos/Benchmarks/premake4.lua
Normal 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",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user