Checks for contacts between two physics bodies.
- iOS 8.0+
- macOS 10.10+
- tvOS 9.0+
- watchOS 3.0+
The first body (to test for contact with the second).
The second body (to test for contact with the first).
A dictionary of options affecting the test, or
nilto use default options. For applicable keys and the possible values, see Physics Test Options Keys.
An array of
SCNPhysics objects describing contacts between the two bodies, or
nil if the bodies are not in contact.
SceneKit sends messages to the physics world’s
contact object only when collisions occur between bodies whose
category properties overlap, and only for collisions between certain types of bodies. (For details, see
SCNPhysics.) Use this method to directly test for contacts between any two bodies at a time of your choosing. For example, to implement a game where the player character can pick up an item, you might call this method when the player presses the “pick up” button to see if the player character is in contact with the item to be picked up.