Adds a behavior to the physics world.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The behavior to be added.
Physics behaviors constrain or modify the effects of the physics simulation on sets of physics bodies. For example, the
SCNPhysics behavior causes two bodies to move as if connected by a hinge that pivots around a specific axis, and the
SCNPhysics behavior causes a body to roll like a car or other wheeled vehicle.
To use a behavior in your scene, follow these steps:
SCNPhysicsobjects and attach them to each node that participates in the behavior.
Create and configure a behavior object joining the physics bodies. See
SCNPhysicsfor a list of behavior classes.
addon your scene’s physics world object to add the behavior to the physics simulation.