forked from zuker/box2d-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Box2D.i
53 lines (46 loc) · 1015 Bytes
/
Box2D.i
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
%module "Box2D"
%rename(_operator) operator();
%rename(_add) operator+;
%rename(_subtract) operator-;
%rename(_multiply) operator*;
%rename(equals) operator==;
%rename(add) operator+=;
%rename(subtract) operator-=;
%rename(multiply) operator*=;
%typemap(out) b2Shape* {
swig_type_info *info = SWIGTYPE_p_b2CircleShape;
b2Shape *shape = 0;
shape = $1;
if (shape) {
switch (shape->GetType())
{
case b2Shape::e_circle:
{
info = SWIGTYPE_p_b2CircleShape;
}
break;
case b2Shape::e_edge:
{
info = SWIGTYPE_p_b2EdgeShape;
}
break;
case b2Shape::e_chain:
{
info = SWIGTYPE_p_b2ChainShape;
}
break;
case b2Shape::e_polygon:
{
info = SWIGTYPE_p_b2PolygonShape;
}
break;
default:
break;
}
}
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), info, 0 | 0 );
}
%{
#include "Box2D/Box2D.h"
%}
%include "Box2D/Box2D.h"