我已经创建了一个body和fixture的列表,一切正常,但是由于某些原因无法删除对象,这里是我的代码(“id”是链接到body和fixture的div的id,信息正在持有身体和夹具数据):HEEEELLPPPPP !!!
var bodyItem;
for(var j=0; j < bodieList.length; j++){
if (bodieList[j].userData.id == id) bodyItem = bodieList[j];
};
//world.DestroyBody (bodyItem);
var fixItem;
for(var i=0; i < fixtureList.length; i++){
//console.log (fixtureList[i].userData.id);
if (fixtureList[i].userData.id == id) fixItem = fixtureList[i];
};
bodyItem.DestroyFixture(fixItem);
world.DestroyBody(bodyItem);