I want to make a top-down view of a truck/snake/train-like object. I took the example in the "Car simulation (top down) following a path" Topic:
http://www.slembcke.net/forums/viewtopi ... path#p4043
And added a "trailer" to the tank with this code in the init method:
Code: Select all
trailerBody = add_box(10.0, 2.0);
cpConstraint *pivotTrailer;
pivotTrailer = cpSpaceAddConstraint(space, cpPivotJointNew2(tankBody, trailerBody, cpv(-20,0), cpv(10,0)));
pivotTrailer->biasCoef =0.1f;
pivotTrailer->maxForce = 10000.0f;
Result was this:
If the violet tank moves in a curve, like in the picture anti-clockwise, the blue box always hinges to the outside. I would have expected the opposite, that a object on a joint would lean to the inside of the curve?