【发布时间】:2014-11-24 22:12:19
【问题描述】:
我有以下 UIBezierPath,它就像一个圆圈,但中间有一个间隙:
var centerPosition = CGPointMake(self.frame.width/2, self.frame.height/2)
var aPath:UIBezierPath = UIBezierPath(arcCenter: centerPosition, radius: 75, startAngle: 0, endAngle: degreesToRadians(size), clockwise: true)
gapeCircle = SKShapeNode(path: myPath, centered: true)
现在我想使用 SKPhysicsBody 以便当一个对象与该对象的轮廓发生碰撞时,会有一个通知。但仅限于那种情况。如果对象在间隙位置“碰撞”,则不应有通知。
但我不知道如何解决这个问题。我已经尝试了多种不同的 SKPhysicsBody-initializers。唯一有效的是circleOfRadius,但它不像我希望的那样有效,因为只有当一个物体与我圈子的“非间隙”部分发生碰撞时,我才需要检查碰撞。
【问题讨论】:
标签: swift sprite-kit collision-detection uibezierpath skphysicsbody