hi,
I have some box,creating using box2d,which restitution's are set to zero.but when they fall over one another there appear bounce event.but i don't want that...i want them not move when fall over another.it can be done if i switch off gravity.but i also want gravity.here is my code
UIImage *imageOfSnowV1 = [ UIImage imageNamed:[NSString stringWithFormat:@"Object%d.png",currentlySelected]];
CCTexture2D *texOfSnowV1 = [[ [CCTexture2D alloc] initWithImage:imageOfSnowV1 ] autorelease];
CCSprite *sprite = [CCSprite spriteWithTexture:texOfSnowV1 rect:CGRectMake(0, 0, 32, 32)];
[self addChild:sprite];
sprite.position = ccp(p.x, p.y);
sprite.tag=[temp intValue];
// Define the dynamic body.
//Set up a 1m squared box in the physics world
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
bodyDef.position.Set(p.x/PTM_RATIO, p.y/PTM_RATIO);
bodyDef.userData = sprite;
b2Body *bodyS = world->CreateBody(&bodyDef);
// Define another box shape for our dynamic body.
b2PolygonShape dynamicBox;
dynamicBox.SetAsBox(.5f, .5f);//These are mid points for our 1m box
b2MassData massData;
massData.mass = 0.1f;
bodyS->SetMassData(&massData);
// Define the dynamic body fixture.
b2FixtureDef fixtureDef;
fixtureDef.shape = &dynamicBox;
fixtureDef.density = 50.0f;
fixtureDef.restitution=0.0f;
fixtureDef.friction = 0.01f;
bodyS->CreateFixture(&fixtureDef);
can anyone help me?