1
을 신청하지 않는 것은 테스트 코드입니다. 중간에 약간의 커브를 추가합니다. 꼭지점에서 꼭지점까지, 그러나 간단한 rect로 테스트하고 싶습니다. 나는 공과의 충돌을 테스트하고 있으며 bottomRight에서 topRight까지의 선과 만 충돌하고 나머지는 무시하는 것처럼 보입니다. 누구가 여기에 무슨 일이 일어나고 있는지에 대한 아이디어가 있습니까?SpriteKit PhysicsBody 내 베 지어 곡선 여기
var polygonPath = CGPathCreateMutable()
CGPathMoveToPoint(polygonPath, nil, bottomRight.x, bottomRight.y)
CGPathAddLineToPoint(polygonPath, nil, topRight.x, topRight.y)
CGPathAddLineToPoint(polygonPath, nil, topLeft.x, topLeft.y)
CGPathAddLineToPoint(polygonPath, nil, bottomLeft.x, bottomLeft.y)
CGPathCloseSubpath(polygonPath)
var n = SKShapeNode(path: polygonPath)
n.strokeColor = UIColor.grayColor()
n.physicsBody = SKPhysicsBody(edgeLoopFromPath: polygonPath)
:
skView.showsPhysics = YES; 모양 주위에 얇은 물리학 체를 볼 수 있습니다. – dragoneye
@dragoneye 팁 주셔서 감사합니다. 적용된 물리 구조가 올바르지 않은 것처럼 보입니다. 다른 제안이 있으십니까? 원본 게시물을 이미지로 업데이트했습니다. – dchhetri