Beginners problem with bounce

Official forum for the Chipmunk2D Physics Library.
Post Reply
93interactive
Posts: 3
Joined: Fri Aug 21, 2009 5:27 am
Contact:

Beginners problem with bounce

Post by 93interactive »

Hello,

I am trying to build a simple scene by having two round objects. one of the objects is positioned over and slightly offsetted to the side of the other object.

the scene has a static segment shape on the ground.

what i want to happen, is to have the round objects reacting like a table tennis ball, bouncing back quite significant and bounce of of each other, but they don't, the just fall down and slide over the floor.

the shapes of the round objects are created with:

Code: Select all

cpBody *body=cpBodyNew(1.0,cpMomentForCircle(1.0,0.0,12.0,cpv(0,0)));
body->p=cpv(posx,posy);
cpSpaceAddBody(space,body);
cpShape *shape=cpCircleShapeNew(body,12.0,cpv(0,0));
shape->e=0.6; shape->u=0.5;
cpScpaeAddShape(space, shape);
the ground is created with:

Code: Select all

cpBody *body=cpBodyNew(INFINITY, INFINITY);
cpShape *shape=cpSegmentShapeNew(body, cpv(0,0),cpv(1280,0), 10);
shape->e=0.6; shape->u=0.5;
cpSpaceAddStaticShape(space, shape);
shouldn't this make them bounce? i tried several values for ->e and ->u on both, but it does not seem to make a major difference.

what am i missing?
93interactive
Posts: 3
Joined: Fri Aug 21, 2009 5:27 am
Contact:

Re: Beginners problem with bounce

Post by 93interactive »

solved, increasing space->elasticIterations did the trick.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests