List of joints attached to a body/Way to instantly remove all joints between two given objects...?

I would like to be able to remove all joints between two given objects, automatically (rather than keeping track of each one with a named variable).

Is there a way to get the table of joints attached to a given display object In the newer builds of corona?
i.e. like myDisplayObj.getJoints()?

Or for that matter a way to get the objects that are effected by a joint?

myJoint.getObj1();
myJoint.getObj2();

I tried adding the information to the joints themselves (i.e. myJoint.obj1={object}), but to no avail. :frowning:

Do I need to create a wrapper object for joints and than keep a reference to it in a table variable in both objects? [import]uid: 144151 topic_id: 26146 reply_id: 326146[/import]

Currently, this is not possible, though I believe it is planned for Corona in the future.

The best way, I’ve found, is to build functions which attach specific joints with appropriate setup, taking each object (anchor and target) as their parameters. The function can then be relied on to add the joint to a list and provide a removeAll() on the list itself. [import]uid: 8271 topic_id: 26146 reply_id: 105896[/import]

Thanks I ended up creating a wrapper class, using Yaci 1.2 for an OOP framework.

[code]
require “class”

JointWrapper = newclass(“JointWrapper”);

function JointWrapper:init(myJoint,obj1,obj2)
self.myJoint=myJoint;
self.obj1=obj1;
self.obj2=obj2;
self.destroyed=false;
end;

function JointWrapper:instanceDestroy()
if(self.destroyed==false) then
self.destroyed=true;
self.myJoint:removeSelf();
end;
end;
[/code] [import]uid: 144151 topic_id: 26146 reply_id: 105906[/import]