Change constraint solver threshold-based termination condition on residual of velocity threshold, not on residual of impulse threshold.

This avoids issues with systems with large mass ratios.

Test: add this to BasicDemo/BasicExample.cpp in initPhysics

	m_dynamicsWorld->getSolverInfo().m_numIterations = 1000;
	m_dynamicsWorld->getSolverInfo().m_leastSquaresResidualThreshold = 1e-4;
This commit is contained in:
Erwin Coumans
2018-07-22 11:30:16 +02:00
parent f8cc33f3a3
commit b5495e789d
4 changed files with 37 additions and 32 deletions

View File

@@ -2954,9 +2954,9 @@ btVector3 PhysicsServerExample::getRayTo(int x,int y)
btVector3 hor;
hor = rayForward.cross(vertical);
hor.normalize();
hor.safeNormalize();
vertical = hor.cross(rayForward);
vertical.normalize();
vertical.safeNormalize();
float tanfov = tanf(0.5f*fov);