void Ball::draw() const
{
- glDrawCircle(radius, &position, color);
+ glDrawCircle(radius, position, color);
}
#include "PhysicsEntity.h"
+#include "../debug.h"
+
#include "../Vector2.h"
/// ***** Public Class Methods *****
PhysicsEntity::PhysicsEntity(const Vector2& pos)
- : Entity(pos)
+ : Entity(pos), mass(1)
{
}
{
Ball* ball;
- // needs to be first for the overlap
ball = new Ball(Vector2(50, 50), 20, cWhite);
+ ball->applyImpulse(Vector2(0.01,0.01)),
Balls.push(ball);
manager::add(ball);
}
-void glDrawCircle(float radius, const Vector2* vec, const float* color)
+void glDrawCircle(float radius, const Vector2& vec, const float* color)
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glTranslatef(vec->x, vec->y, -1);
+ glTranslatef(vec.x, vec.y, -1);
glScalef(radius, radius, radius);
if(color != NULL)
void graphicsInit();
void graphicsCleanUp();
-void glDrawCircle(float radius, const Vector2*, const float* color = 0);
+void glDrawCircle(float radius, const Vector2&, const float* color = 0);
#endif // GRAPHICS_H
{
return tickCountMicro() / 1000000;
}
-
-// return after num milliseconds
-void wait(int num)
-{
- long int start;
- int numMicro = num * 1000;
-
- start = tickCountMicro();
- while(tickCountMicro() - start < numMicro);
-}
-
// returns the current microseconds from program start
long int tickCountMicro();
-void wait(int);
-
#endif // TICKS_H