allow some existing demos to run in the TestFrameWork

This commit is contained in:
ejcoumans
2007-10-21 04:22:43 +00:00
parent 85b4b149b7
commit 095f5f42a9
11 changed files with 192 additions and 75 deletions

View File

@@ -71,7 +71,6 @@ subject to the following restrictions:
#include "BMF_Api.h"
#include <stdio.h> //printf debugging
float deltaTime = 1.f/60.f;
float gCollisionMargin = 0.05f;
#include "CcdPhysicsDemo.h"
#include "GL_ShapeDrawer.h"
@@ -172,6 +171,11 @@ void CcdPhysicsDemo::createStack( btCollisionShape* boxShape, float halfCubeSize
btRigidBody* body = 0;
body = localCreateRigidBody(mass,trans,boxShape);
#ifdef USER_DEFINED_FRICTION_MODEL
///Advanced use: override the friction solver
body->m_frictionSolverType = USER_CONTACT_SOLVER_TYPE1;
#endif //USER_DEFINED_FRICTION_MODEL
}
}
}
@@ -220,25 +224,10 @@ void customNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher&
GLDebugDrawer debugDrawer;
//experimental jitter damping (1 = no damping, 0 = total damping once motion below threshold)
extern btScalar gJitterVelocityDampingFactor;
int main(int argc,char** argv)
{
gJitterVelocityDampingFactor = 0.7;
CcdPhysicsDemo* ccdDemo = new CcdPhysicsDemo();
ccdDemo->initPhysics();
#ifdef DO_BENCHMARK_PYRAMIDS
ccdDemo->setCameraDistance(26.f);
#endif
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",ccdDemo);
}
@@ -371,6 +360,11 @@ float myFrictionModel( btRigidBody& body1, btRigidBody& body2, btManifoldPoint&
void CcdPhysicsDemo::initPhysics()
{
#ifdef DO_BENCHMARK_PYRAMIDS
setCameraDistance(2.5f);
#endif
#ifdef DO_BENCHMARK_PYRAMIDS
m_azi = 90.f;
#endif //DO_BENCHMARK_PYRAMIDS
@@ -487,7 +481,6 @@ int maxNumOutstandingTasks = 4;
m_dynamicsWorld->getDispatchInfo().m_enableSPU = true;
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
m_dynamicsWorld->setDebugDrawer(&debugDrawer);
#ifdef USER_DEFINED_FRICTION_MODEL

View File

@@ -0,0 +1,29 @@
/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it freely,
subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "CcdPhysicsDemo.h"
#include "GlutStuff.h"
int main(int argc,char** argv)
{
CcdPhysicsDemo* ccdDemo = new CcdPhysicsDemo();
ccdDemo->initPhysics();
return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",ccdDemo);
}