Refactoring:
Moved optional code to Extras: AlgebraicCCD,EPA,quickstep Moved SimpleBroadphase data to OverlappingPairCache, and derive both SimpleBroadphase and AxisSweep3 from OverlappingPairCache. Added ParallelPhysicsEnvironment (prepair more parallel mainloop) Upgraded hardcoded limit from 1024/8192 to 32766/65535 (max objects / max overlapping pairs)
This commit is contained in:
@@ -69,14 +69,17 @@ extern float eye[3];
|
||||
extern int glutScreenWidth;
|
||||
extern int glutScreenHeight;
|
||||
|
||||
const int maxProxies = 32766;
|
||||
const int maxOverlap = 65535;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
const int numObjects = 22;
|
||||
const int numObjects = 5000;
|
||||
#else
|
||||
const int numObjects = 120;
|
||||
const int numObjects = 2000;
|
||||
#endif
|
||||
|
||||
const int maxNumObjects = 450;
|
||||
const int maxNumObjects = 32760;
|
||||
|
||||
MyMotionState ms[maxNumObjects];
|
||||
CcdPhysicsController* physObjects[maxNumObjects] = {0,0,0,0};
|
||||
@@ -127,11 +130,11 @@ int main(int argc,char** argv)
|
||||
CollisionDispatcher* dispatcher = new CollisionDispatcher();
|
||||
|
||||
|
||||
SimdVector3 worldAabbMin(-10000,-10000,-10000);
|
||||
SimdVector3 worldAabbMax(10000,10000,10000);
|
||||
SimdVector3 worldAabbMin(-30000,-30000,-30000);
|
||||
SimdVector3 worldAabbMax(30000,30000,30000);
|
||||
|
||||
BroadphaseInterface* broadphase = new AxisSweep3(worldAabbMin,worldAabbMax);
|
||||
//BroadphaseInterface* broadphase = new SimpleBroadphase();
|
||||
//BroadphaseInterface* broadphase = new AxisSweep3(worldAabbMin,worldAabbMax,maxProxies,maxOverlap);
|
||||
BroadphaseInterface* broadphase = new SimpleBroadphase(maxProxies,maxOverlap);
|
||||
|
||||
physicsEnvironmentPtr = new CcdPhysicsEnvironment(dispatcher,broadphase);
|
||||
physicsEnvironmentPtr->setDeactivationTime(2.f);
|
||||
|
||||
@@ -22,8 +22,8 @@ subject to the following restrictions:
|
||||
#include "Dynamics/RigidBody.h"
|
||||
#include "BroadphaseCollision/AxisSweep3.h"
|
||||
|
||||
#include "ConstraintSolver/SimpleConstraintSolver.h"
|
||||
#include "ConstraintSolver/OdeConstraintSolver.h"
|
||||
#include "ConstraintSolver/SequentialImpulseConstraintSolver.h"
|
||||
//#include "ConstraintSolver/OdeConstraintSolver.h"
|
||||
#include "CollisionDispatch/CollisionDispatcher.h"
|
||||
#include "BroadphaseCollision/SimpleBroadphase.h"
|
||||
#include "CollisionShapes/TriangleMeshShape.h"
|
||||
@@ -216,8 +216,8 @@ int main(int argc,char** argv)
|
||||
|
||||
// GLDebugDrawer debugDrawer;
|
||||
|
||||
//ConstraintSolver* solver = new SimpleConstraintSolver;
|
||||
ConstraintSolver* solver = new OdeConstraintSolver;
|
||||
ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
|
||||
//ConstraintSolver* solver = new OdeConstraintSolver;
|
||||
|
||||
CollisionDispatcher* dispatcher = new CollisionDispatcher();
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ subject to the following restrictions:
|
||||
#include "CollisionShapes/EmptyShape.h"
|
||||
|
||||
#include "Dynamics/RigidBody.h"
|
||||
#include "ConstraintSolver/SimpleConstraintSolver.h"
|
||||
#include "ConstraintSolver/OdeConstraintSolver.h"
|
||||
#include "ConstraintSolver/SequentialImpulseConstraintSolver.h"
|
||||
//#include "ConstraintSolver/OdeConstraintSolver.h"
|
||||
#include "CollisionDispatch/CollisionDispatcher.h"
|
||||
#include "BroadphaseCollision/SimpleBroadphase.h"
|
||||
#include "IDebugDraw.h"
|
||||
@@ -72,7 +72,7 @@ int main(int argc,char** argv)
|
||||
{
|
||||
|
||||
|
||||
ConstraintSolver* solver = new SimpleConstraintSolver;
|
||||
ConstraintSolver* solver = new SequentialImpulseConstraintSolver;
|
||||
//ConstraintSolver* solver = new OdeConstraintSolver;
|
||||
|
||||
CollisionDispatcher* dispatcher = new CollisionDispatcher();
|
||||
|
||||
@@ -48,9 +48,11 @@ subject to the following restrictions:
|
||||
#include "NarrowPhaseCollision/Epa.h"
|
||||
#include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
|
||||
#include "NarrowPhaseCollision/EpaPenetrationDepthSolver.h"
|
||||
EpaPenetrationDepthSolver epaPenDepthSolver;
|
||||
|
||||
|
||||
SimplexSolverInterface simplexSolver;
|
||||
EpaPenetrationDepthSolver epaPenDepthSolver;
|
||||
|
||||
|
||||
int screenWidth = 640.f;
|
||||
int screenHeight = 480.f;
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
#include "NarrowPhaseCollision/GjkConvexCast.h"
|
||||
#include "NarrowPhaseCollision/ContinuousConvexCollision.h"
|
||||
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
|
||||
|
||||
#ifdef USE_ALGEBRAIC_CCD
|
||||
#include "NarrowPhaseCollision/BU_CollisionPair.h"
|
||||
#endif //USE_ALGEBRAIC_CCD
|
||||
|
||||
#include "CollisionShapes/SphereShape.h"
|
||||
|
||||
@@ -191,7 +194,7 @@ void clientDisplay(void) {
|
||||
GjkConvexCast convexCaster1(shapePtr[0],shapePtr[i],&gGjkSimplexSolver);
|
||||
|
||||
//BU_CollisionPair (algebraic version) is currently broken, will look into this
|
||||
BU_CollisionPair convexCaster2(shapePtr[0],shapePtr[i]);
|
||||
//BU_CollisionPair convexCaster2(shapePtr[0],shapePtr[i]);
|
||||
SubsimplexConvexCast convexCaster3(shapePtr[0],shapePtr[i],&gGjkSimplexSolver);
|
||||
|
||||
gGjkSimplexSolver.reset();
|
||||
|
||||
@@ -30,8 +30,9 @@ Very basic raytracer, rendering into a texture.
|
||||
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
|
||||
#include "NarrowPhaseCollision/GjkConvexCast.h"
|
||||
#include "NarrowPhaseCollision/ContinuousConvexCollision.h"
|
||||
#ifdef USE_ALGEBRAIC_CCD
|
||||
#include "NarrowPhaseCollision/BU_CollisionPair.h"
|
||||
|
||||
#endif //USE_ALGEBRAIC_CCD
|
||||
|
||||
|
||||
#include "CollisionShapes/SphereShape.h"
|
||||
|
||||
Reference in New Issue
Block a user