Add EdgeShape:getPoints()

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-29 11:19:30 -04:00
parent fa58c87605
commit 5d26c564e0
4 changed files with 31 additions and 0 deletions
+14
View File
@@ -23,6 +23,7 @@
// Module
#include "Body.h"
#include "World.h"
#include "Physics.h"
#include <common/Memoizer.h>
@@ -43,6 +44,19 @@ namespace box2d
delete shape;
shape = NULL;
}
int EdgeShape::getPoints(lua_State * L)
{
b2EdgeShape * e = (b2EdgeShape *)shape;
b2Vec2 v1 = Physics::scaleUp(e->m_vertex1);
b2Vec2 v2 = Physics::scaleUp(e->m_vertex2);
lua_pushnumber(L, v1.x);
lua_pushnumber(L, v1.y);
lua_pushnumber(L, v2.x);
lua_pushnumber(L, v2.y);
return 4;
}
} // box2d
} // physics