bullet3 icon indicating copy to clipboard operation
bullet3 copied to clipboard

`btRigidBody` with all-zero `m_linearFactor` and non-zero `m_angularFactor` will not collide with onther static objects

Open JiangboYu13 opened this issue 4 months ago • 1 comments

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

JiangboYu13 avatar Feb 21 '24 01:02 JiangboYu13

The expression: if (m_angularFactor) { ... } is always true. Looks like the compiler implicitly casts "operator btScalar *()" from pointer to bool.

bgossage avatar Mar 01 '24 22:03 bgossage