Problem implementing Universal Joint limits

patie

13-04-2007 07:00:02

i'm trying to make a universal joint that is atached as a child to a body attached by a slider to the body of a Simplecar. the slider works properly. the universal joint is attached at the right position to the sliding body.

What is not right, is that the calculateStopAlpha() and setCallbackAccel() function called in the custom callback used by my UniversalJoint derived class don't seems to have no effect. The body attached by the universal joint is spinning around axes it should not.

Is there something missing in my doing?

the callback
static void UniversalCallBack(OgreNewt::BasicJoints::Universal* uni)
{
Ogre::Radian angle0 = uni->getJointAngle0();
Ogre::Radian angle1 = uni->getJointAngle1();
Ogre::Real accel;

if(angle0.valueDegrees()>Ogre::Real(10))
{
accel = uni->calculateStopAlpha0(angle0.valueDegrees());
uni->setCallbackAccel(accel,0);

}
if(angle0.valueDegrees()<Ogre::Real(-10))
{
accel = uni->calculateStopAlpha0(angle0.valueDegrees());
uni->setCallbackAccel(accel,0);

}

if(angle1.valueDegrees()>Ogre::Real(10))
{
accel = uni->calculateStopAlpha1(angle1.valueDegrees());
uni->setCallbackAccel(accel,1);

}
if(angle1.valueDegrees()<Ogre::Real(-10))
{
accel = uni->calculateStopAlpha1(angle1.valueDegrees());
uni->setCallbackAccel(accel,1);

}

};


the class constructor

PatiUniversal::PatiUniversal(OgreNewt::World* monde, OgreNewt::Body* child, OgreNewt::Body* parent, Ogre::Vector3 point,Ogre::Vector3 pin,Ogre::Vector3 pin2)
: OgreNewt::BasicJoints::Universal(monde,child,parent,point,pin,pin2)
{
m_parent = parent;
m_child = child;
setCallback(UniversalCallBack);
}


the parameters
bearing = new PatiUniversal(mWorld,DiscBearing,shaft,m_Position,Ogre::Vector3(1,0,0),Ogre::Vector3(0,1,0));

patie

16-04-2007 01:24:27

I tried using Hinges to do the work, it's still not perfect but it's already better, what appears now is that my hinged cylinder (to the car) gets it's orientation modified a bit by the movement of the car when i drive around, could it be the parameters like stifness or maximum /minimum friction that would cause this?

here's a screenshot

the leftmost cylinder is attached as an hinge to the chassis, the smallest is attached to the chassis by a slider (moving front/rear) and the big right is a hinge attached to the slider.

I'm using this setup to simulate a clutch for a manual transmission.