bullet3
bullet3 copied to clipboard
`btRigidBody` with all-zero `m_linearFactor` and non-zero `m_angularFactor` will not collide with onther static objects
A btRigidBody
with all zero m_linearFactor
but non-zero m_angularFactor
should still collide with other static objects which changes the angular velocity. But due to the code in btSequentialImpulseConstraintSolver.cpp:
solverBody->internalSetInvMass(btVector3(rb->getInvMass(), rb->getInvMass(), rb->getInvMass()) * rb->getLinearFactor());
in btSequentialImpulseConstraintSolver::initSolverBody
and
if (!solverBodyA || (solverBodyA->m_invMass.fuzzyZero() && (!solverBodyB || solverBodyB->m_invMass.fuzzyZero())))
in btSequentialImpulseConstraintSolver::convertContact
the collision will not occur
The expression: if (m_angularFactor) { ... } is always true. Looks like the compiler implicitly casts "operator btScalar *()" from pointer to bool.