Type Method

bodyWithEdgeFromPoint:toPoint:

Creates an edge between two points.

Declaration

+ (SKPhysicsBody *)bodyWithEdgeFromPoint:(CGPoint)p1 toPoint:(CGPoint)p2;

Parameters

p1

The starting point for the edge, relative to the owning node’s origin.

p2

The ending point for the edge, relative to the owning node’s origin.

Return Value

A new edge-based physics body.

Discussion

An edge has no volume or mass and is always treated as if the dynamic property is equal to NO. Edges may only collide with volume-based physics bodies.

See Also

Creating an Edge-Based Physics Body

Creating an Edge Loop Around a Scene

Border your scene with an obstacle that physics bodies cannot penetrate.

bodyWithEdgeLoopFromRect:

Creates an edge loop from a rectangle.

bodyWithEdgeLoopFromPath:

Creates an edge loop from a path.

bodyWithEdgeChainFromPath:

Creates an edge chain from a path.