updated quickstep solver (for comparison), enabled GPU physics again (but WIN32 doesn't have the VertexTextureSupport enabled)
This commit is contained in:
@@ -13,14 +13,16 @@ subject to the following restrictions:
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
|
||||
//#define USE_GROUND_BOX 1
|
||||
#define PRINT_CONTACT_STATISTICS 1
|
||||
//#define CHECK_MEMORY_LEAKS 1
|
||||
|
||||
int gNumObjects = 120;
|
||||
#define HALF_EXTENTS 1.f
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
#include "GLDebugDrawer.h"
|
||||
#include "BMF_Api.h"
|
||||
#include <stdio.h> //printf debugging
|
||||
float deltaTime = 1.f/60.f;
|
||||
float gCollisionMargin = 0.05f;
|
||||
@@ -37,11 +39,15 @@ int main(int argc,char** argv)
|
||||
BasicDemo ccdDemo;
|
||||
ccdDemo.initPhysics();
|
||||
ccdDemo.setCameraDistance(50.f);
|
||||
|
||||
#ifdef CHECK_MEMORY_LEAKS
|
||||
ccdDemo.exitPhysics();
|
||||
|
||||
//return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",&ccdDemo);
|
||||
#else
|
||||
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",&ccdDemo);
|
||||
#endif
|
||||
|
||||
//default glut doesn't return from mainloop
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
||||
#define REGISTER_CUSTOM_COLLISION_ALGORITHM 1
|
||||
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
|
||||
#include "../Extras/quickstep/OdeConstraintSolver.h"
|
||||
#include "LinearMath/btQuickprof.h"
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
#include "GLDebugDrawer.h"
|
||||
@@ -47,11 +47,12 @@ bool useCompound = false;//true;//false;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
const int gNumObjects = 120;
|
||||
const int gNumObjects = 1024;
|
||||
#else
|
||||
const int gNumObjects = 120;//try this in release mode: 3000. never go above 16384, unless you increate maxNumObjects value in DemoApplication.cp
|
||||
#endif
|
||||
|
||||
|
||||
const int maxNumObjects = 32760;
|
||||
|
||||
int shapeIndex[maxNumObjects];
|
||||
@@ -76,8 +77,8 @@ btCollisionShape* shapePtr[numShapes] =
|
||||
new btBoxShape (btVector3(50,10,50)),
|
||||
#endif
|
||||
|
||||
new btCylinderShape (btVector3(CUBE_HALF_EXTENTS-gCollisionMargin,CUBE_HALF_EXTENTS-gCollisionMargin,CUBE_HALF_EXTENTS-gCollisionMargin)),
|
||||
//new btBoxShape (btVector3(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS)),
|
||||
//new btCylinderShape (btVector3(1-gCollisionMargin,CUBE_HALF_EXTENTS-gCollisionMargin,1-gCollisionMargin)),
|
||||
new btBoxShape (btVector3(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS)),
|
||||
new btSphereShape (CUBE_HALF_EXTENTS- 0.05f),
|
||||
|
||||
//new btConeShape(CUBE_HALF_EXTENTS,2.f*CUBE_HALF_EXTENTS),
|
||||
@@ -249,7 +250,8 @@ void CcdPhysicsDemo::initPhysics()
|
||||
dispatcher->registerCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new btSphereSphereCollisionAlgorithm::CreateFunc);
|
||||
#endif //REGISTER_CUSTOM_COLLISION_ALGORITHM
|
||||
|
||||
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
|
||||
//btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
|
||||
btConstraintSolver* solver = new OdeConstraintSolver();
|
||||
|
||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver);
|
||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||
|
||||
Reference in New Issue
Block a user