-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContactListener.h
55 lines (40 loc) · 992 Bytes
/
ContactListener.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
45
46
47
48
49
50
51
52
53
54
55
/*
* ContactListener.h
*
* Created on: 8 maj 2010
* Author: meros
*/
#ifndef CONTACTLISTENER_H_
#define CONTACTLISTENER_H_
#include <Box2D/Box2D.h>
class Rope;
class UserData {
public:
UserData() :
myType(Unknown) {
}
virtual void BeginContact(b2Contact* contact) {
}
virtual void EndContact(b2Contact* contact) {
}
virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) {
}
virtual void PostSolve(b2Contact* contact,
const b2ContactImpulse* impulse) {
}
virtual void TouchedRope(Rope* aRope, b2Body* aBpdy) {
}
enum Type {
Unknown, Player,
} myType;
};
class ContactListener: public b2ContactListener {
public:
ContactListener(b2World& aWorld);
virtual ~ContactListener();
void BeginContact(b2Contact* contact);
void EndContact(b2Contact* contact);
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);
};
#endif /* CONTACTLISTENER_H_ */