~neon/kolf/master

« back to all changes in this revision

Viewing changes to ball.cpp

  • Committer: Stefan Majewsky
  • Date: 2010-10-31 23:23:16 UTC
  • Revision ID: git-v1:45f6fdbcc5733b0daa25631ea13b5b2f2d86f20e
Create a Box2D world, and attach Box2D bodies to all CanvasItems.

This is unfortunately a very large patch, because it touches everything
in the CanvasItem hierarchy, the ItemFactory, the KolfGame and the
shapes at once. All these objects are closely related through Box2D's
object hierarchy (world -> bodies -> fixtures -> shapes), so these
changes can hardly be split up further.

svn path=/trunk/KDE/kdegames/kolf/; revision=1191711

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <QApplication>
25
25
 
26
 
Ball::Ball(QGraphicsItem* parent)
27
 
        : EllipticalCanvasItem(true, QLatin1String("ball"), parent)
 
26
Ball::Ball(QGraphicsItem* parent, b2World* world)
 
27
        : EllipticalCanvasItem(true, QLatin1String("ball"), parent, world)
28
28
{
29
29
        const int diameter = 8;
30
30
        setSize(QSizeF(diameter, diameter));