Exposed shape:getBody

This commit is contained in:
Bart van Strien
2010-08-09 12:32:10 +02:00
parent 48a94f32d9
commit 310a50ba2f
5 changed files with 7 additions and 4 deletions
+1 -3
View File
@@ -23,6 +23,7 @@
// LOVE
#include <physics/Shape.h>
#include <physics/box2d/Body.h>
#include <common/Reference.h>
// Box2D
@@ -34,9 +35,6 @@ namespace physics
{
namespace box2d
{
// Forward declarations.
class Body;
/**
* This struct is stored in a void pointer
* in the Box2D Shape class. For now, all we
@@ -71,6 +71,7 @@ namespace box2d
{ "getFriction", w_Shape_getFriction },
{ "getRestitution", w_Shape_getRestitution },
{ "getDensity", w_Shape_getDensity },
{ "getBody", w_Shape_getBody },
{ "isSensor", w_Shape_isSensor },
{ "testPoint", w_Shape_testPoint },
{ "testSegment", w_Shape_testSegment },
@@ -49,6 +49,7 @@ namespace box2d
{ "getFriction", w_Shape_getFriction },
{ "getRestitution", w_Shape_getRestitution },
{ "getDensity", w_Shape_getDensity },
{ "getBody", w_Shape_getBody },
{ "isSensor", w_Shape_isSensor },
{ "testPoint", w_Shape_testPoint },
{ "testSegment", w_Shape_testSegment },
+2
View File
@@ -107,6 +107,7 @@ namespace box2d
Body * body = t->getBody();
if(body == 0)
return 0;
body->retain();
luax_newtype(L, "Body", PHYSICS_BODY_T, (void*)body);
return 1;
}
@@ -233,6 +234,7 @@ namespace box2d
{ "getFriction", w_Shape_getFriction },
{ "getRestitution", w_Shape_getRestitution },
{ "getDensity", w_Shape_getDensity },
{ "getBody", w_Shape_getBody },
{ "isSensor", w_Shape_isSensor },
{ "testPoint", w_Shape_testPoint },
{ "testSegment", w_Shape_testSegment },