forked from kripken/box2d.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglue_stub.cpp
More file actions
27 lines (20 loc) · 723 Bytes
/
glue_stub.cpp
File metadata and controls
27 lines (20 loc) · 723 Bytes
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
#include <Box2D/Box2D.h>
typedef b2Shape::Type b2ShapeType;
typedef b2ContactFeature::Type b2ContactFeatureType;
typedef b2Manifold::Type b2ManifoldType;
typedef uint32 b2DrawFlag;
// Map SayGoodbye({b2Joint,b2Fixture}*) to SayGoodbye{Joint,Fixture}(..),
// so that the JS implementation can listen for both callbacks.
class b2DestructionListenerWrapper : b2DestructionListener {
public:
virtual ~b2DestructionListenerWrapper() {}
virtual void SayGoodbyeJoint(b2Joint* joint) = 0;
virtual void SayGoodbyeFixture(b2Fixture* fixture) = 0;
void SayGoodbye(b2Joint* joint) {
SayGoodbyeJoint(joint);
}
void SayGoodbye(b2Fixture* fixture) {
SayGoodbyeFixture(fixture);
}
};
#include "box2d_glue.cpp"