Contents

init(edgeFrom:to:)

Creates an edge between two points.

Declaration

init(edgeFrom p1: CGPoint, to p2: CGPoint)

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.

Mentioned in

Return Value

A new edge-based physics body.

Discussion

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

See Also

Creating an Edge-Based Physics Body