在本练习中,我的物理机构遇到了一些问题。
当点(蛇)移动得非常快时,它会通过砖的物理物体“挤压”自身。有人可以帮忙吗?
蛇:
self.physicsBody.categoryBitMask = snakeCategory;
self.physicsBody.collisionBitMask = lineCategory | brickCollissionCategory;
self.physicsBody.contactTestBitMask = brickContactCategory;
self.physicsBody.usesPreciseCollisionDetection = YES;
self.physicsBody.allowsRotation = NO;
self.physicsBody.dynamic = YES;
self.physicsBody.restitution = 0;
self.physicsBody.affectedByGravity = NO;
砖:
self.physicsBody.categoryBitMask = brickCollissionCategory;
self.physicsBody.collisionBitMask = snakeCategory;
self.physicsBody.dynamic = NO;
self.physicsBody.affectedByGravity = NO;
self.physicsBody.usesPreciseCollisionDetection = YES;
self.physicsBody.restitution = 0;