Creates a field that applies random forces to objects in its area of effect, with magnitudes proportional to those objects’ velocities.
SDKs
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
Framework
- Scene
Kit
Declaration
class func turbulenceField(smoothness: CGFloat, animationSpeed speed: CGFloat) -> SCNPhysics Field
Parameters
smoothness
The amount of randomness in the field. A value of
0
specifies maximum noise, and a value of.0 1
specifies no noise at all..0 speed
The field’s variation over time. Specify
0
for a static field..0
Return Value
A physics field object. To use the field in a scene, attach it to the physics
property of an SCNNode
object.
Discussion
Like a noise field, a turbulence field applies forces in random directions to the objects that it affects. Unlike a noise field, a turbulence field applies a force whose magnitude is proportional to the speed of each affected object. For example, an object passing through a noise field shakes as it travels through the field, but an object passing through a turbulence field shakes more violently the faster it travels. The field’s strength
property scales the magnitude of the turbulence effect.
The default falloff
value for a turbulence field is 0
, indicating that the field’s effect is constant throughout its area of effect.