I want attach to my kinect depth point box2d circles. I have such code in draw
if(kinect.getDistanceAt(x, y) > 0 && kinect.getDistanceAt(x, y) < 1000) {
mesh.addVertex(kinect.getWorldCoordinateAt(x, y));
my_cirk.destroy();
ofPoint q = kinect.getWorldCoordinateAt(x, y);
my_cirk.setPhysics(3.0, 0.53, 0.1);
my_cirk.setup(box2d.getWorld(),q.x,q.y,30);
rectse.push_back(my_cirk);
for(int i=0; i<rectse.size(); i++) {
rectse[i].draw();
}
in update i have rectse.clear();
program draw all circles but only last have physics. If i haw 20 circles all 19 will be only draw, without physics. If i remove my_cirk.destroy(); or type it in update. The physics objects will draw without limits, not with my depth point