Disable DX11 cloth bounds update, it is too slow by default.

Use g_dx11Solver->setEnableUpdateBounds(true); to re-enable it (it enables GPU collision of cloth versus capsule)
This commit is contained in:
erwin.coumans 2011-09-14 20:55:00 +00:00
parent 385933b5ed
commit b68c64f2db
3 changed files with 20 additions and 2 deletions

View File

@ -496,7 +496,11 @@ void initBullet(void)
#endif
#endif
if (g_dx11SIMDSolver)
g_dx11SIMDSolver->setEnableUpdateBounds(true);
if (g_dx11Solver)
g_dx11Solver->setEnableUpdateBounds(true);
// Initialise CPU physics device
//m_collisionConfiguration = new btDefaultCollisionConfiguration();

View File

@ -565,7 +565,8 @@ btDX11SoftBodySolver::btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11Devi
m_dx11CollisionObjectDetails( m_dx11Device, m_dx11Context, &m_collisionObjectDetails, true ),
m_dx11PerClothMinBounds( m_dx11Device, m_dx11Context, &m_perClothMinBounds, false ),
m_dx11PerClothMaxBounds( m_dx11Device, m_dx11Context, &m_perClothMaxBounds, false ),
m_dx11PerClothFriction( m_dx11Device, m_dx11Context, &m_perClothFriction, false )
m_dx11PerClothFriction( m_dx11Device, m_dx11Context, &m_perClothFriction, false ),
m_enableUpdateBounds(false)
{
// Initial we will clearly need to update solver constants
// For now this is global for the cloths linked with this solver - we should probably make this body specific
@ -2201,7 +2202,8 @@ void btDX11SoftBodySolver::predictMotion( float timeStep )
// Update bounds
// Will update the bounds for all softBodies being dealt with by the solver and
// set the values in the btSoftBody object
updateBounds();
if (m_enableUpdateBounds)
updateBounds();
// End prediction work for solvers
}

View File

@ -212,6 +212,7 @@ public:
*/
void updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound );
// TODO: All of these set functions will have to do checks and
// update the world because restructuring of the arrays will be necessary
// Reasonable use of "friend"?
@ -513,6 +514,7 @@ protected:
DXFunctions::KernelDesc applyForcesKernel;
bool m_enableUpdateBounds;
/**
* Integrate motion on the solver.
@ -575,6 +577,16 @@ public:
return DX_SOLVER;
}
void setEnableUpdateBounds(bool enableBounds)
{
m_enableUpdateBounds = enableBounds;
}
bool getEnableUpdateBounds() const
{
return m_enableUpdateBounds;
}
virtual btSoftBodyLinkData &getLinkData();