# Swift - How do I detect the exact point at which two “SKPhysicsBody(edgeFromPoint:” type physics bodies intersect in sprite kit

I have two physics bodies attached to two separate sprite nodes using Sprit Kit. One is a vertical line and one is a horizontal line:

//sprite with horizontal physics body
spriteMatrix[i][j].physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(0, tileSegmentHeight), toPoint: CGPointMake(tileSegmentWidth, tileSegmentHeight))

//sprite with vertical physics body
self.hero.physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(self.hero.frame.width / 2, self.hero.frame.height / 2), toPoint: CGPointMake(self.hero.frame.width / 2, -20))


What I'm want to do is test if they are intersecting on every frame, and if they are, return the x and y position of where they are intersecting. Is this even possible?

• I'd like to add that I plan to implement sloped physics bodies later so being that I we know the x an y positions already isn't going to cut it. – tedesignz Apr 28 '15 at 5:30

You are not using collisionBitMask The class reference can be found Here

A example of code is Here which also explains very well how collisionBitMask works

This is not possible. Apparently, only a dynamic volume physics body can make contact with an edge body. I do not like this about Sprite Kit.