I am building a sidescrolling bike game and i cant seem to get the wheels to turn freely both angular directions, i can only get my wheels to rotate in the left direction, but when i set the motor torque to a positive number the wheels arent moving at all.
/////Init
myBackWheelDef.type = b2_dynamicBody;
myBackWheelDef.position.Set(myBackDampBody->GetWorldCenter().x,myBackDampBody->GetWorldCenter().y);
myBackWheelBody = myWorld->CreateBody(&myBackWheelDef);
myBackWheelShape.m_radius = 19.0/PTM_RATIO;
myAxleDefBack.Initialize(myBackWheelBody, myBackDampBody, myBackDampBody->GetWorldCenter());
myAxleDefBack.enableMotor = true;
myAxleBack = reinterpret_cast<b2RevoluteJoint*>(myWorld->CreateJoint(&myAxleDefBack));
myBackWheelFixtureDef.shape = &myBackWheelShape;
myBackWheelFixtureDef.density = 1.1f;
myBackWheelFixtureDef.friction = 10.8f;
myBackWheelFixtureDef.filter.groupIndex = -1;
myBackWheelBody->CreateFixture(&myBackWheelFixtureDef);
//////Update
myAxleBack->SetMaxMotorTorque(10); /// Wheel doesnt turn
if i do this the wheel wont turn, if i i put a - before the 10 it works
myAxleBack->SetMaxMotorTorque(-10); //// Wheel Turns
the wheel is connected to a body that is connected to another body with a prismatic joint, everything works perfectly except this, what the F am i missing?
/////Init
myBackWheelDef.type = b2_dynamicBody;
myBackWheelDef.position.Set(myBackDampBody->GetWorldCenter().x,myBackDampBody->GetWorldCenter().y);
myBackWheelBody = myWorld->CreateBody(&myBackWheelDef);
myBackWheelShape.m_radius = 19.0/PTM_RATIO;
myAxleDefBack.Initialize(myBackWheelBody, myBackDampBody, myBackDampBody->GetWorldCenter());
myAxleDefBack.enableMotor = true;
myAxleBack = reinterpret_cast<b2RevoluteJoint*>(myWorld->CreateJoint(&myAxleDefBack));
myBackWheelFixtureDef.shape = &myBackWheelShape;
myBackWheelFixtureDef.density = 1.1f;
myBackWheelFixtureDef.friction = 10.8f;
myBackWheelFixtureDef.filter.groupIndex = -1;
myBackWheelBody->CreateFixture(&myBackWheelFixtureDef);
//////Update
myAxleBack->SetMaxMotorTorque(10); /// Wheel doesnt turn
if i do this the wheel wont turn, if i i put a - before the 10 it works
myAxleBack->SetMaxMotorTorque(-10); //// Wheel Turns
the wheel is connected to a body that is connected to another body with a prismatic joint, everything works perfectly except this, what the F am i missing?