I have a dynamic body that slips when it lands on a static physics body and it also slips sometimes after a collision with a static body.I have set the restitution of my static body to 1. I am using the default Chipmunk
This is how I am creating my wall/floor which is static
Sprite* sp = Sprite::create();
sp->setContentSize(Size(w,h));
sp->setPosition(SetAnchorFromCenter(Vec2(x,y), sp->getContentSize()));
PhysicsBody* pb= PhysicsBody::createEdgeBox(Size(w,h),PhysicsMaterial(0,1,0),1,tileMap->getPosition());
//pb->setContactTestBitmask(true);
pb->setDynamic(false);
sp->setPhysicsBody(pb);
this->addChild(sp);
This is how I am creating my dynamic object
sprite_eagle = Sprite::createWithSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("tmp-10.gif"));
sprite_eagle->setPosition(50,450);
sprite_eagle->setAnchorPoint(Vec2(0.5,0.5));
this->addChild(sprite_eagle);
//Create the physics body for the sprite_eagle
PhysicsBody* sprite_eagle_body= PhysicsBody::createCircle((sprite_eagle->getContentSize().width)/2,PhysicsMaterial(0,0,0));
sprite_eagle->setPhysicsBody(sprite_eagle_body);
I believe a physics body by default is dynamic.
This is how I am moving my object
sprite_eagle->getPhysicsBody()->setVelocity(vel);
Any suggestion on why my dynamic body sprite is sliding ?