Hi, I am attempting to create a prismatic joint for the first time. The Joint itself seems to work (i think) but I have a problem with limits. When I set up a upper limit and add some motor speed the body rises as expected. But it never stops even when it reaches the upper limit.
Firstly, should this stop automatically if the joint is set up correctly?
Second, how do I check if the upper limit has been reached? Inside b2PrismaticJoint.cpp I can see that the lines
are run but I don't understand how I can get hold of the m_limitState as this is protected.
Any help would be great.
Thanks
Firstly, should this stop automatically if the joint is set up correctly?
Second, how do I check if the upper limit has been reached? Inside b2PrismaticJoint.cpp I can see that the lines
Code:
if (m_limitState != e_atUpperLimit)
{
m_limitState = e_atUpperLimit;
m_impulse.z = 0.0f;
}
{
m_limitState = e_atUpperLimit;
m_impulse.z = 0.0f;
}
are run but I don't understand how I can get hold of the m_limitState as this is protected.
Any help would be great.
Thanks