Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (37 sloc) 734 Bytes
/**
* Bajo la licencia GPL-3 ó superior.
*
* Copyright (C) 2008 Rafael Fernández López
*/
#ifndef SURFACE_H
#define SURFACE_H
#include <QtCore/QTimer>
#include <QtGui/QGraphicsScene>
class Surface
: public QGraphicsScene
{
public:
Surface(QObject *parent = 0)
: QGraphicsScene(parent)
, m_friction(0.99)
{
QTimer *timer = new QTimer(this);
timer->setInterval(10);
connect(timer, SIGNAL(timeout()), this, SLOT(advance()));
timer->start();
}
~Surface()
{
}
void setFriction(float friction)
{
m_friction = friction;
}
float friction() const
{
return m_friction;
}
private:
float m_friction;
};
#endif