mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-10 17:30:12 +00:00
BulletMultiThreaded needs to refreshContactPoint for contact manifold (this has been moved to the collision detector, instead of constraint solver)
BulletMultiThreaded support function for box shouldn't compensate for the collision margin anymore
This commit is contained in:
parent
43b0ecd71a
commit
ffcdb0f93d
@ -366,7 +366,7 @@ void CcdPhysicsDemo::initPhysics()
|
||||
#endif //DO_BENCHMARK_PYRAMIDS
|
||||
|
||||
btCollisionDispatcher* dispatcher=0;
|
||||
|
||||
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||
|
||||
#ifdef USE_PARALLEL_DISPATCHER
|
||||
|
||||
@ -387,10 +387,10 @@ int maxNumOutstandingTasks = 4;//number of maximum outstanding tasks
|
||||
#endif
|
||||
|
||||
|
||||
dispatcher = new SpuGatheringCollisionDispatcher(threadSupportCollision,maxNumOutstandingTasks);
|
||||
// dispatcher = new btCollisionDispatcher();
|
||||
dispatcher = new SpuGatheringCollisionDispatcher(threadSupportCollision,maxNumOutstandingTasks,collisionConfiguration);
|
||||
// dispatcher = new btCollisionDispatcher(collisionConfiguration);
|
||||
#else
|
||||
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||
|
||||
dispatcher = new btCollisionDispatcher(collisionConfiguration);
|
||||
#endif //USE_PARALLEL_DISPATCHER
|
||||
|
||||
@ -450,7 +450,11 @@ int maxNumOutstandingTasks = 4;//number of maximum outstanding tasks
|
||||
|
||||
btDiscreteDynamicsWorld* world = new btDiscreteDynamicsWorld(dispatcher,broadphase,solver);
|
||||
m_dynamicsWorld = world;
|
||||
// world->getSolverInfo().m_numIterations = 4;
|
||||
|
||||
#ifdef DO_BENCHMARK_PYRAMIDS
|
||||
world->getSolverInfo().m_numIterations = 4;
|
||||
#endif //DO_BENCHMARK_PYRAMIDS
|
||||
|
||||
m_dynamicsWorld->getDispatchInfo().m_enableSPU = true;
|
||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||
|
||||
|
@ -252,7 +252,7 @@ void GimpactConcaveDemo::renderme()
|
||||
|
||||
//bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP);
|
||||
|
||||
bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD);
|
||||
bool useCCD = ((getDebugMode() & btIDebugDraw::DBG_EnableCCD) != 0);
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD);
|
||||
|
@ -1600,7 +1600,7 @@ void ConcaveDemo::renderme()
|
||||
|
||||
//bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP);
|
||||
|
||||
bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD);
|
||||
bool useCCD = ((getDebugMode() & btIDebugDraw::DBG_EnableCCD) != 0);
|
||||
|
||||
glRasterPos3f(xOffset,yStart,0);
|
||||
sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD);
|
||||
@ -1643,7 +1643,7 @@ void ConcaveDemo::initGImpactCollision()
|
||||
|
||||
void ConcaveDemo::initPhysics()
|
||||
{
|
||||
|
||||
|
||||
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||
|
||||
//btConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
|
||||
|
@ -170,6 +170,14 @@ void SpuContactResult::addContactPoint(const btVector3& normalOnBInWorld,const b
|
||||
|
||||
void SpuContactResult::flush()
|
||||
{
|
||||
|
||||
if (m_spuManifold && m_spuManifold->getNumContacts())
|
||||
{
|
||||
m_spuManifold->refreshContactPoints(m_rootWorldTransform0,m_rootWorldTransform1);
|
||||
m_RequiresWriteBack = true;
|
||||
}
|
||||
|
||||
|
||||
if (m_RequiresWriteBack)
|
||||
{
|
||||
#ifdef DEBUG_SPU_COLLISION_DETECTION
|
||||
|
@ -48,9 +48,8 @@ inline btPoint3 localGetSupportingVertexWithoutMargin(int shapeType, void* shape
|
||||
{
|
||||
// spu_printf("SPU: getSupport BOX_SHAPE_PROXYTYPE\n");
|
||||
btConvexInternalShape* convexShape = (btConvexInternalShape*)shape;
|
||||
btVector3 halfExtents = convexShape->getImplicitShapeDimensions();
|
||||
float margin = convexShape->getMarginNV();
|
||||
halfExtents -= btVector3(margin,margin,margin);
|
||||
const btVector3& halfExtents = convexShape->getImplicitShapeDimensions();
|
||||
|
||||
return btPoint3(
|
||||
localDir.getX() < 0.0f ? -halfExtents.x() : halfExtents.x(),
|
||||
localDir.getY() < 0.0f ? -halfExtents.y() : halfExtents.y(),
|
||||
|
@ -64,8 +64,8 @@ CONCAVE_SHAPES_END_HERE,
|
||||
|
||||
|
||||
///btBroadphaseProxy
|
||||
ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
|
||||
//struct btBroadphaseProxy
|
||||
//ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
|
||||
struct btBroadphaseProxy
|
||||
{
|
||||
|
||||
BT_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
@ -33,8 +33,9 @@ btOverlappingPairCache::btOverlappingPairCache():
|
||||
{
|
||||
int initialAllocatedSize= 2;
|
||||
m_overlappingPairArray.reserve(initialAllocatedSize);
|
||||
|
||||
#ifdef USE_HASH_PAIRCACHE
|
||||
growTables();
|
||||
#endif //USE_HASH_PAIRCACHE
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user