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:
@@ -496,7 +496,11 @@ void initBullet(void)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (g_dx11SIMDSolver)
|
||||||
|
g_dx11SIMDSolver->setEnableUpdateBounds(true);
|
||||||
|
|
||||||
|
if (g_dx11Solver)
|
||||||
|
g_dx11Solver->setEnableUpdateBounds(true);
|
||||||
|
|
||||||
// Initialise CPU physics device
|
// Initialise CPU physics device
|
||||||
//m_collisionConfiguration = new btDefaultCollisionConfiguration();
|
//m_collisionConfiguration = new btDefaultCollisionConfiguration();
|
||||||
|
|||||||
@@ -565,7 +565,8 @@ btDX11SoftBodySolver::btDX11SoftBodySolver(ID3D11Device * dx11Device, ID3D11Devi
|
|||||||
m_dx11CollisionObjectDetails( m_dx11Device, m_dx11Context, &m_collisionObjectDetails, true ),
|
m_dx11CollisionObjectDetails( m_dx11Device, m_dx11Context, &m_collisionObjectDetails, true ),
|
||||||
m_dx11PerClothMinBounds( m_dx11Device, m_dx11Context, &m_perClothMinBounds, false ),
|
m_dx11PerClothMinBounds( m_dx11Device, m_dx11Context, &m_perClothMinBounds, false ),
|
||||||
m_dx11PerClothMaxBounds( m_dx11Device, m_dx11Context, &m_perClothMaxBounds, 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
|
// 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
|
// For now this is global for the cloths linked with this solver - we should probably make this body specific
|
||||||
@@ -2201,6 +2202,7 @@ void btDX11SoftBodySolver::predictMotion( float timeStep )
|
|||||||
// Update bounds
|
// Update bounds
|
||||||
// Will update the bounds for all softBodies being dealt with by the solver and
|
// Will update the bounds for all softBodies being dealt with by the solver and
|
||||||
// set the values in the btSoftBody object
|
// set the values in the btSoftBody object
|
||||||
|
if (m_enableUpdateBounds)
|
||||||
updateBounds();
|
updateBounds();
|
||||||
|
|
||||||
// End prediction work for solvers
|
// End prediction work for solvers
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound );
|
void updateBounds( const btVector3 &lowerBound, const btVector3 &upperBound );
|
||||||
|
|
||||||
|
|
||||||
// TODO: All of these set functions will have to do checks and
|
// TODO: All of these set functions will have to do checks and
|
||||||
// update the world because restructuring of the arrays will be necessary
|
// update the world because restructuring of the arrays will be necessary
|
||||||
// Reasonable use of "friend"?
|
// Reasonable use of "friend"?
|
||||||
@@ -513,6 +514,7 @@ protected:
|
|||||||
|
|
||||||
DXFunctions::KernelDesc applyForcesKernel;
|
DXFunctions::KernelDesc applyForcesKernel;
|
||||||
|
|
||||||
|
bool m_enableUpdateBounds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integrate motion on the solver.
|
* Integrate motion on the solver.
|
||||||
@@ -575,6 +577,16 @@ public:
|
|||||||
return DX_SOLVER;
|
return DX_SOLVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setEnableUpdateBounds(bool enableBounds)
|
||||||
|
{
|
||||||
|
m_enableUpdateBounds = enableBounds;
|
||||||
|
}
|
||||||
|
bool getEnableUpdateBounds() const
|
||||||
|
{
|
||||||
|
return m_enableUpdateBounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtual btSoftBodyLinkData &getLinkData();
|
virtual btSoftBodyLinkData &getLinkData();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user