Greetings,
I have been looking into a problem I had today and I think it is related to how I destroyed some bodies attached to joints. I realized that part of this issues is just a manual errata/clarification issue, but there is something more.
For my purposes, I was setting the body types to static before removal. This appears to be causing issues inside the subsequent step as I was getting ASSERT failure from inside:
and in:
The reason I found this surprising was that in the manual it says:
which I think might be better written as:
Now while this may seem to just be a clarification for the manual it is worth noting that the code (as far as I can tell) in the pulley joint is still going to throw and assert even if only one body is static (or even kinematic). Which is exactly what I was seeing.
Anyway, like I said, part os the issue was me misinterpreting the manual and the other part seems to be that pulley joints don't allow either body to be static.
Please let me know if I missed something.
Regards,
Q
I have been looking into a problem I had today and I think it is related to how I destroyed some bodies attached to joints. I realized that part of this issues is just a manual errata/clarification issue, but there is something more.
For my purposes, I was setting the body types to static before removal. This appears to be causing issues inside the subsequent step as I was getting ASSERT failure from inside:
Code:
void b2RevoluteJoint::InitVelocityConstraints(const b2TimeStep& step)
// You cannot create a rotation limit between bodies that
// both have fixed rotation.
b2Assert(b1->m_invI > 0.0f || b2->m_invI > 0.0f); // <---------- This was failing the assert
// You cannot create a rotation limit between bodies that
// both have fixed rotation.
b2Assert(b1->m_invI > 0.0f || b2->m_invI > 0.0f); // <---------- This was failing the assert
and in:
Code:
void b2PulleyJoint::InitVelocityConstraints(const b2TimeStep& step)
b2Assert(m_limitMass1 > b2_epsilon);
b2Assert(m_limitMass2 > b2_epsilon); // <------------- This was failing the assert
b2Assert(m_pulleyMass > b2_epsilon);
b2Assert(m_limitMass1 > b2_epsilon);
b2Assert(m_limitMass2 > b2_epsilon); // <------------- This was failing the assert
b2Assert(m_pulleyMass > b2_epsilon);
The reason I found this surprising was that in the manual it says:
Code:
All joints are connected between two different bodies. One body may static. Joints between static and/or kinematic bodies are allowed, but have no effect and use some processing time.
which I think might be better written as:
Code:
All joints are connected between two different bodies. Only one body may static. The other body must NOT be static (it must be either Dynamic or kinematic). While a joint between a static body and a kinematic body is allowed, it will have no effect and use some processing time.
Now while this may seem to just be a clarification for the manual it is worth noting that the code (as far as I can tell) in the pulley joint is still going to throw and assert even if only one body is static (or even kinematic). Which is exactly what I was seeing.
Anyway, like I said, part os the issue was me misinterpreting the manual and the other part seems to be that pulley joints don't allow either body to be static.
Please let me know if I missed something.
Regards,
Q