Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JiangboYu13 opened this issue Feb 21, 2024 · 1 comment

Comments

@JiangboYu13
Copy link

JiangboYu13 commented Feb 21, 2024

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 JiangboYu13 changed the title btRigidBody with all-zero m_linearFactor and non-zero 'm_angularFactor ' will not collide with onther static objects btRigidBody with all-zero m_linearFactor and non-zero 'm_angularFactor' will not collide with onther static objects Feb 21, 2024
@JiangboYu13 JiangboYu13 changed the title btRigidBody with all-zero m_linearFactor and non-zero 'm_angularFactor' will not collide with onther static objects btRigidBody with all-zero m_linearFactor and non-zero m_angularFactor will not collide with onther static objects Feb 21, 2024
@bgossage
Copy link
Contributor

bgossage commented Mar 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants