我正在尝试使用chipmunk6.x并遇到问题。它不是在创造物理环境。如何在我的项目中启用chipmunk6.x 物理环境?空间管理系统运行良好。我希望花栗鼠库附件没有问题。我正在使用我刚刚替换了花栗鼠库的 cocos2d 旧版本。
space = cpSpaceNew();
space->gravity = cpv(0, -100);
//
// rogue shapes
// We have to free them manually
//
// bottom
cpShape *walls_[4];
walls_[0] = cpSegmentShapeNew( space->staticBody, cpv(0,0), cpv(s.width,0), 0.0f);
// top
walls_[1] = cpSegmentShapeNew( space->staticBody, cpv(0,s.height), cpv(s.width,s.height), 0.0f);
// left
walls_[2] = cpSegmentShapeNew( space->staticBody, cpv(0,0), cpv(0,s.height), 0.0f);
// right
walls_[3] = cpSegmentShapeNew( space->staticBody, cpv(s.width,0), cpv(s.width,s.height), 0.0f);
for( int i=0;i<4;i++) {
walls_[i]->e = 1.0f;
walls_[i]->u = 1.0f;
cpSpaceAddStaticShape(space, walls_[i] );
}