#include "Ball.h"
+#include "../debug.h"
+
#include "../Vector2.h"
#include "../graphics/graphics.h"
/// ***** Public Class Methods *****
-Ball::Ball(Vector2 pos, float radius)
- : PhysicsEntity(pos), radius(radius)
+Ball::Ball(const Vector2& pos, float radius, const float* color)
+ : PhysicsEntity(pos), radius(radius), color(color)
{
}
void Ball::draw() const
{
- // TODO
-
- glDrawCircle(radius, &position);
+ glDrawCircle(radius, &position, color);
}
class Ball: public PhysicsEntity
{
public:
- Ball(Vector2, float);
+ Ball(const Vector2&, float radius, const float* color);
virtual ~Ball();
virtual void draw() const;
protected:
float radius;
- // color;
+ const float* color;
};
#endif // BALL_H
/// ***** Public Class Methods *****
-Entity::Entity(Vector2 pos)
+Entity::Entity(const Vector2& pos)
: position(pos), velocity(0,0)
{
class Entity
{
protected:
- Entity(Vector2);
+ Entity(const Vector2&);
public:
virtual ~Entity();
#include "../Vector2.h"
/// ***** Public Class Methods *****
-Line::Line(Vector2 org, Vector2 dest, bool canDie)
+Line::Line(const Vector2& org, const Vector2& dest, bool canDie)
: Particle(org, canDie), dest(dest)
{
}
-Line::Line(Vector2 org, Vector2 dest, float life_time)
+Line::Line(const Vector2& org, const Vector2& dest, float life_time)
: Particle(org, life_time), dest(dest)
{
class Line: public Particle
{
public:
- Line(Vector2, Vector2, bool=true);
- Line(Vector2, Vector2, float);
+ Line(const Vector2&, const Vector2&, bool=true);
+ Line(const Vector2&, const Vector2&, float);
virtual ~Line();
virtual void draw();
#include "../Vector2.h"
/// ***** Public Class Methods *****
-Particle::Particle(Vector2 pos, bool canDie)
+Particle::Particle(const Vector2& pos, bool canDie)
: Entity(pos), canDie(canDie)
{
}
-Particle::Particle(Vector2 pos, float lifeTime)
+Particle::Particle(const Vector2& pos, float lifeTime)
: Entity(pos), lifeTime(lifeTime)
{
class Particle: public Entity
{
protected:
- Particle(Vector2, bool=true);
- Particle(Vector2, float);
+ Particle(const Vector2&, bool=true);
+ Particle(const Vector2&, float);
public:
virtual ~Particle();
#include "../Vector2.h"
/// ***** Public Class Methods *****
-PhysicsEntity::PhysicsEntity(Vector2 pos)
+PhysicsEntity::PhysicsEntity(const Vector2& pos)
: Entity(pos)
{
class PhysicsEntity: public Entity
{
protected:
- PhysicsEntity(Vector2);
+ PhysicsEntity(const Vector2&);
public:
virtual ~PhysicsEntity();
#include "../Vector2.h"
/// ***** Public Class Methods *****
-Point::Point(Vector2 org, bool canDie)
+Point::Point(const Vector2& org, bool canDie)
: Particle(org, canDie), radius(2)
{
}
-Point::Point(Vector2 org, float life_time)
+Point::Point(const Vector2& org, float life_time)
: Particle(org, life_time), radius(2)
{
class Point: public Particle
{
public:
- Point(Vector2, bool=true);
- Point(Vector2, float);
+ Point(const Vector2&, bool=true);
+ Point(const Vector2&, float);
virtual ~Point();
virtual void draw();
#include "../Vector2.h"
/// ***** Public Class Methods *****
-Polygon::Polygon(Vector2 pos, vector<Vector2> points)
+Polygon::Polygon(const Vector2& pos, vector<Vector2> points)
: PhysicsEntity(pos), points(points)
{
CreateBindingBox();
class Polygon: public PhysicsEntity
{
public:
- Polygon(Vector2, vector<Vector2>);
+ Polygon(const Vector2&, vector<Vector2>);
virtual ~Polygon();
virtual void draw() const;
#include "../Vector2.h"
/// ***** Public Class Methods *****
-WindParticle::WindParticle(Vector2 org, float life_time)
+WindParticle::WindParticle(const Vector2& org, float life_time)
: Point(org, life_time)
{
class WindParticle: public Point
{
public:
- WindParticle(Vector2, float);
+ WindParticle(const Vector2&, float);
virtual ~WindParticle();
virtual void update(float);