About PhysicsWorld

About PhysicsWorld
0.0 0


I want to let it spin like a windmill when a ball hits a sprite by not gravity.
This code does not rotate even if it hits the ball.

dogSpr3 = Sprite::create(“p6.png”);
dogSpr3->setPosition(Vec2((visibleSize.width/2 + origin.x) +0, (visibleSize.height/2 + origin.y) -0));
dogBody3 = PhysicsBody::createCircle(dogSpr3->getContentSize().width / 2, PhysicsMaterial(0.5f, 0.5f, 0.5f));
dogBody3->setDynamic(false); // not gravity
this->addChild(dogSpr3, 1);


Did you look in cpp-tests for an example?