![]() |
HeadBall
1.0
A game
|
Class for shape and movement of ball. More...
#include <Ball.hpp>
Public Member Functions | |
Ball (GameDataRef data, WorldRef world) | |
Construct a new Ball object. More... | |
void | init () |
Initiate the Ball object. More... | |
sf::CircleShape | shape () |
Return the shape of the Ball object. More... | |
void | processPosition () |
Process the position of the Ball object. More... | |
void | rePosition () |
Place the ball at the starting position. More... | |
b2Body * | body () |
Return the Box2D body of the ball. More... | |
Private Attributes | |
GameDataRef | _data |
The Shared Pointer of the game data. More... | |
WorldRef | _world |
The Shared Pointer of Box2D World. More... | |
sf::CircleShape | _shape |
The SFML shape of the ball. More... | |
b2BodyDef | _bodyDef |
The Definition of Box2D body. More... | |
b2Body * | _body |
The Box2D body of ball. More... | |
b2CircleShape | _circleShape |
The circle shape for fixture definition. More... | |
b2FixtureDef | _fixture |
The fixture of ball for defining its properties. More... | |
Class for shape and movement of ball.
HeadBall::Ball::Ball | ( | GameDataRef | data, |
WorldRef | world | ||
) |
Construct a new Ball object.
data | The Shared Pointer for game data |
world | The Shared pointer for Box2D world |
b2Body * HeadBall::Ball::body | ( | ) |
Return the Box2D body of the ball.
void HeadBall::Ball::init | ( | ) |
Initiate the Ball object.
void HeadBall::Ball::processPosition | ( | ) |
Process the position of the Ball object.
This function processes the position of the CircleShape as per the position of body in Box2D
void HeadBall::Ball::rePosition | ( | ) |
Place the ball at the starting position.
sf::CircleShape HeadBall::Ball::shape | ( | ) |
|
private |
The Box2D body of ball.
|
private |
The Definition of Box2D body.
|
private |
The circle shape for fixture definition.
|
private |
The Shared Pointer of the game data.
|
private |
The fixture of ball for defining its properties.
|
private |
The SFML shape of the ball.
|
private |
The Shared Pointer of Box2D World.