Hello again.
After finally figuring out how to create joints properly, I created a top-down car.
The car consists of 5 boxes, 4 for the tires and one for the car body.
I created 2 revolute joints for the steering tires, and 2 prismatic joints for the back tires.
I anchored them as follows:
The positions are correct, in the game I rendered that shapes and it all aligns until I start driving the car!
I also tried not using the Initialize(...) function, but it yielded the same results: The joints all just spin around the center of the car body.
Actually, the wheels even steer properly, turning around the center of the wheel, but after taking a curve, they all shift out of alignment and spin around the center of the car.
Here are some images to help describe what I'm getting:


What should I do?
EDIT:
I actually tried out some more joints, putting in all kinds of anchor positions, but all produce the same behavior!
See below:
None have any effect at all!
After finally figuring out how to create joints properly, I created a top-down car.
The car consists of 5 boxes, 4 for the tires and one for the car body.
I created 2 revolute joints for the steering tires, and 2 prismatic joints for the back tires.
I anchored them as follows:
Code:
b2RevoluteJointDef leftFrontJointDef;
leftFrontJointDef.Initialize(leftFrontWheel, carBody, leftFrontWheel->GetWorldCenter());
leftFrontJointDef.enableMotor = true;
leftFrontJointDef.maxMotorTorque = 100;
leftJoint = world->CreateJoint(&leftJointDef);
leftRevJoint = static_cast<b2RevoluteJoint*>(leftJoint);
b2RevoluteJointDef rightFrontJointDef;
rightFrontJointDef.Initialize(rightFrontWheel, carBody, rightFrontWheel->GetWorldCenter());
rightFrontJointDef.enableMotor = true;
rightFrontJointDef.maxMotorTorque = 100;
rightJoint = world->CreateJoint(&rightJointDef);
rightRevJoint = static_cast<b2RevoluteJoint*>(rightJoint);
b2PrismaticJointDef leftRearJointDef;
leftRearJointDef.Initialize(leftRearWheel, carBody, leftRearWheel->GetWorldCenter(), b2Vec2(1,0));
leftRearJointDef.enableLimit = true;
leftRearJointDef.lowerTranslation = leftRearJointDef.upperTranslation = 0;
b2PrismaticJointDef rightRearJointDef;
rightRearJointDef.Initialize(rightRearWheel, carBody, rightRearWheel->GetWorldCenter(), b2Vec2(1,0));
rightRearJointDef.enableLimit = true;
rightRearJointDef.lowerTranslation = rightRearJointDef.upperTranslation = 0;
leftFrontJointDef.Initialize(leftFrontWheel, carBody, leftFrontWheel->GetWorldCenter());
leftFrontJointDef.enableMotor = true;
leftFrontJointDef.maxMotorTorque = 100;
leftJoint = world->CreateJoint(&leftJointDef);
leftRevJoint = static_cast<b2RevoluteJoint*>(leftJoint);
b2RevoluteJointDef rightFrontJointDef;
rightFrontJointDef.Initialize(rightFrontWheel, carBody, rightFrontWheel->GetWorldCenter());
rightFrontJointDef.enableMotor = true;
rightFrontJointDef.maxMotorTorque = 100;
rightJoint = world->CreateJoint(&rightJointDef);
rightRevJoint = static_cast<b2RevoluteJoint*>(rightJoint);
b2PrismaticJointDef leftRearJointDef;
leftRearJointDef.Initialize(leftRearWheel, carBody, leftRearWheel->GetWorldCenter(), b2Vec2(1,0));
leftRearJointDef.enableLimit = true;
leftRearJointDef.lowerTranslation = leftRearJointDef.upperTranslation = 0;
b2PrismaticJointDef rightRearJointDef;
rightRearJointDef.Initialize(rightRearWheel, carBody, rightRearWheel->GetWorldCenter(), b2Vec2(1,0));
rightRearJointDef.enableLimit = true;
rightRearJointDef.lowerTranslation = rightRearJointDef.upperTranslation = 0;
The positions are correct, in the game I rendered that shapes and it all aligns until I start driving the car!
I also tried not using the Initialize(...) function, but it yielded the same results: The joints all just spin around the center of the car body.
Actually, the wheels even steer properly, turning around the center of the wheel, but after taking a curve, they all shift out of alignment and spin around the center of the car.
Here are some images to help describe what I'm getting:


What should I do?
EDIT:
I actually tried out some more joints, putting in all kinds of anchor positions, but all produce the same behavior!
See below:
Code:
b2DistanceJointDef distTL;
distTL.Initialize(carBody, leftWheel, leftFrontWheelPosition, leftWheel->GetWorldCenter());
distTL.collideConnected = false;
world->CreateJoint(&distTL);
b2DistanceJointDef distTR;
distTR.Initialize(carBody, rightWheel, rightFrontWheelPosition, rightWheel->GetWorldCenter());
distTR.collideConnected = false;
world->CreateJoint(&distTR);
b2DistanceJointDef distBL;
distBL.Initialize(carBody, leftRearWheel, leftRearWheelPosition, leftRearWheel->GetWorldCenter());
distBL.collideConnected = false;
world->CreateJoint(&distBL);
b2DistanceJointDef distBR;
distBR.Initialize(carBody, rightRearWheel, rightRearWheelPosition, rightRearWheel->GetWorldCenter());
distBR.collideConnected = false;
world->CreateJoint(&distBR);
distTL.Initialize(carBody, leftWheel, leftFrontWheelPosition, leftWheel->GetWorldCenter());
distTL.collideConnected = false;
world->CreateJoint(&distTL);
b2DistanceJointDef distTR;
distTR.Initialize(carBody, rightWheel, rightFrontWheelPosition, rightWheel->GetWorldCenter());
distTR.collideConnected = false;
world->CreateJoint(&distTR);
b2DistanceJointDef distBL;
distBL.Initialize(carBody, leftRearWheel, leftRearWheelPosition, leftRearWheel->GetWorldCenter());
distBL.collideConnected = false;
world->CreateJoint(&distBL);
b2DistanceJointDef distBR;
distBR.Initialize(carBody, rightRearWheel, rightRearWheelPosition, rightRearWheel->GetWorldCenter());
distBR.collideConnected = false;
world->CreateJoint(&distBR);
None have any effect at all!
