First of all you need to make sure your
Scene is created with physics enabled. You do this by calling
auto scene = Scene::createWithPhysics(); where relevant in your code. If not, none of the physics you'll try will work.
Next, you shouldn't pay too much attention to the material right now, what you should probably focus on is the
PhysicsBody class and its methods and variables.
For instance, if I were to make a simple ball physics object I'd do something like this :
auto sprite = Sprite::create("ball.png");
auto physicsBody = PhysicsBody::createCircle(16.0f); // 16 being the radius of the circle
Repeat this a few times, changing the
setVelocity(Vec2(x, y)); as needed, see if you can get a bunch of balls moving around on the screen. I believe they will bump into each other by default. You could also use
physicsBody->applyForce(Point(x, y)); or
More information on both can be find in the class documentation here: