如何更新 chupmunk 中的空间 我的代码是:
// left
shape1 = cpSegmentShapeNew(edge, cpvzero, cpv(0.0f, size.height), 0.0f);
shape1->u = 0.1f; // minimal friction on the ground
shape1->e = 0.7f;
cpSpaceAddStaticShape(_space, shape1); // a body can be represented by multiple shapes
// top
shape2 = cpSegmentShapeNew(edge, cpvzero, cpv(size.width, 0.0f), 0.0f);
shape2->u = 0.1f;
shape2->e = 0.7f;
cpSpaceAddStaticShape(_space, shape2);
// right
shape3 = cpSegmentShapeNew(edge, cpv(size.width, 0.0f), cpv(size.width, size.height), 0.0f);
shape3->u = 0.1f;
shape3->e = 0.7f;
cpSpaceAddStaticShape(_space, shape3);
// bottom
shape4 = cpSegmentShapeNew(edge, cpv(0.0f, size.height), cpv(size.width, size.height), 0.0f);
shape4->u = 0.1f;
shape4->e = 0.7f;
cpSpaceAddStaticShape(_space, shape4);
如果球像这个球一样接触底部形状,但底部形状被移除并显示绿线,我希望这样做,但我不知道如何从身体上移除形状。欢迎任何人提出建议。