A physics behavior that modifies a physics body to behave like a car, motorcycle, or other wheeled vehicle.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
To build a vehicle, designate an
SCNPhysics object as its chassis and an array of
SCNPhysics objects as its wheels. For each wheel, you define physical characteristics such as suspension and traction, and associate a node in your scene to provide the wheel’s size and visual representation. After you construct a vehicle, you can control it in terms of acceleration, braking, and steering.
Although it’s also possible to use a set of physics bodies and joints to collectively simulate a wheeled vehicle, the
SCNPhysics class implements a higher-level simulation that provides realistic vehicle behavior with more efficient simulation performance.