mirror of
https://github.com/love2d/love-android.git
synced 2026-08-19 20:20:25 +02:00
Using latest changeset 593639000823 of love-android
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2014 LOVE Development Team
|
||||
* Copyright (c) 2006-2015 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
@@ -28,6 +28,9 @@
|
||||
#include "World.h"
|
||||
#include "Physics.h"
|
||||
|
||||
// Needed for luax_pushjoint.
|
||||
#include "wrap_Joint.h"
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace physics
|
||||
@@ -440,6 +443,30 @@ int Body::getFixtureList(lua_State *L) const
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Body::getJointList(lua_State *L) const
|
||||
{
|
||||
lua_newtable(L);
|
||||
const b2JointEdge *je = body->GetJointList();
|
||||
int i = 1;
|
||||
|
||||
do
|
||||
{
|
||||
if (!je)
|
||||
break;
|
||||
|
||||
Joint *joint = (Joint *) Memoizer::find(je->joint);
|
||||
if (!joint)
|
||||
throw love::Exception("A joint has escaped Memoizer!");
|
||||
|
||||
luax_pushjoint(L, joint);
|
||||
lua_rawseti(L, -2, i);
|
||||
i++;
|
||||
}
|
||||
while ((je = je->next));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Body::getContactList(lua_State *L) const
|
||||
{
|
||||
lua_newtable(L);
|
||||
|
||||
Reference in New Issue
Block a user