i don't understand why my character bounces against the ground : when the character touches the ground, the trunk goes a bit down "inside" the legs, and then takes its position a bit above. Would anyone know how to fix it?
I set the "restitution" to 0 for each body part, and i added lowerTranslation/upperTranslation to 0 (otherwise the trunk goes through the legs) :
legs = [CCSprite spriteWithSpriteFrameName:@"legs.png"];
legsBody = [self createLegsAtLocation:
axisTransform.Set(b2Vec2(0, 0), body->GetAngle());
b2Vec2 axis = b2Mul(axisTransform.R, b2Vec2(0,1));
legsBody->GetWorldPoint(b2Vec2(0.0/PTM_RATIO, -70.0/PTM_RATIO)), axis);
prisJointDef.enableLimit = true;
prisJointDef.lowerTranslation = 0.0/PTM_RATIO;
prisJointDef.upperTranslation = 0.0/PTM_RATIO;
I've tried to show this with those images : the first one show the size of the trunk and the legs, and the second one shows that the trunk goes through the legs :
Capture d’écran 2012-06-21 à 22.00.58.png [ 27.76 KiB | Viewed 284 times ]
Capture d’écran 2012-06-21 à 22.00.34.png [ 30.52 KiB | Viewed 284 times ]
Also, the legs go through the trunk in this example, is there a way to fix this?
Capture d’écran 2012-06-21 à 21.47.31.png [ 70.9 KiB | Viewed 285 times ]
Thanks a lot for your help