-
Notifications
You must be signed in to change notification settings - Fork 1
/
RocketBit.h
44 lines (31 loc) · 889 Bytes
/
RocketBit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef ROCKETBIT_H
#define ROCKETBIT_H
#include <QGraphicsItem>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include <QWidget>
#include "opencv2/opencv.hpp"
#include "GraphicsPhysicsItem.h"
#include "MoveDetector.h"
class RocketBit : public GraphicsPhysicsItem
{
public:
RocketBit(QGraphicsItem *parent = Q_NULLPTR);
virtual ~RocketBit();
QRectF boundingRect() const override;
QPainterPath shape() const override;
void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget) override;
void putToPhysicsWorld();
void updatePosByMovieDetector();
void moveToDefaultPos();
void setMoveDetector(MoveDetector *iMoveDetector);
protected:
qreal width;
qreal height;
QColor color;
MoveDetector *moveDetector;
b2MouseJoint *mouseJoint;
};
#endif // ROCKETBIT_H