我正在创建一个这样的精灵:
CatSprite *aCat = [CatSprite spriteWithFile:@"Icon-Small.png"];
// add sprite to CCLayer
[self addChild:aCat];
// and then define the body and shape
cpBody *body = cpBodyNew(10.0f, cpMomentForPoly(1000.0f, num, verts, CGPointZero));
body->p = ccp(x, y);
cpSpaceAddBody(space, body);
cpShape* shape = cpPolyShapeNew(body, num, verts, CGPointZero);
shape->e = 0.5f; shape->u = 1.0f;
shape->data = aCat;
cpSpaceAddShape(space, shape);
我正在将物理和约束应用于花栗鼠空间中的身体。我想要的是禁用身体旋转的显示,换句话说,当身体旋转时,我希望精灵保持在 0 度。请问有什么想法吗?
谢谢