Creates a physics shape based on a geometry object.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
A geometry object.
A dictionary of options affecting the level of detail of the physics shape, or
nilto use default options. For applicable keys and their possible values, see Shape Creation Options Keys.
A new physics shape object.
If you create a physics shape using one of the basic geometry classes (
SCNCapsule), SceneKit uses an idealized form of that geometry for the physics shape instead of using the geometry’s vertex data to simulate collisions. For example, if you create a physics shape from an
SCNSphere object, SceneKit simulates collisions for any object that passes within the sphere’s radius.
Because the idealized forms of simple geometries are computationally much simpler than the vertex data needed for displaying them, using basic geometries for physics shapes (or compound shapes created from basic geometries with the
init(shapes: method) often provides the best balance between simulation accuracy and performance.