iOS Developer Library

Developer

SpriteKit Framework Reference SKPhysicsContact Class Reference

Options
Deployment Target:

On This Page
Language:

SKPhysicsContact

An SKPhysicsContact object is created automatically by Sprite Kit to describe a contact between two physical bodies in a physics world. More...

Inheritance


Conforms To


Import Statement


import SpriteKit @import SpriteKit;

Availability


Available in iOS 7.0 and later.
  • bodyA bodyA Property

    The first body in the contact. (read-only)

    Declaration

    Swift

    var bodyA: SKPhysicsBody! { get }

    Objective-C

    @property(nonatomic, readonly) SKPhysicsBody *bodyA

    Import Statement

    import SpriteKit

    Availability

    Available in iOS 7.0 and later.

  • bodyB bodyB Property

    The second body in the contact. (read-only)

    Declaration

    Swift

    var bodyB: SKPhysicsBody! { get }

    Objective-C

    @property(nonatomic, readonly) SKPhysicsBody *bodyB

    Import Statement

    import SpriteKit

    Availability

    Available in iOS 7.0 and later.

  • The contact point between the two physics bodies, in scene coordinates. (read-only)

    Declaration

    Swift

    var contactPoint: CGPoint { get }

    Objective-C

    @property(nonatomic, readonly) CGPoint contactPoint

    Import Statement

    import SpriteKit

    Availability

    Available in iOS 7.0 and later.

  • The impulse that specifies how hard these two bodies struck each other in newton-seconds. (read-only)

    Declaration

    Swift

    var collisionImpulse: CGFloat { get }

    Objective-C

    @property(nonatomic, readonly) CGFloat collisionImpulse

    Import Statement

    import SpriteKit

    Availability

    Available in iOS 7.0 and later.

  • The normal vector specifying the direction of the collision. (read-only)

    Declaration

    Swift

    var contactNormal: CGVector { get }

    Objective-C

    @property(nonatomic, readonly) CGVector contactNormal

    Import Statement

    import SpriteKit

    Availability

    Available in iOS 8.0 and later.