Creates a circular physics body centered on the owning node’s origin.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 3.0+
The radius of the circle.
A new volume-based physics body.
The following code shows the code that creates the physics body for a spherical or circular object. Because the physics body is attached to a sprite object, it usually needs volume. In this case, the sprite image is assumed to closely approximate a circle centered on the anchor point, so the radius of the circle is calculated and used to create the physics body.
If the physics body were significantly smaller than the sprite’s image, the data used to create the physics body might need to be provided by some other source, such as a property list.