noiseField(withSmoothness:animationSpeed:)
Creates a field node that applies a randomized acceleration to physics bodies.
Declaration
class func noiseField(withSmoothness smoothness: CGFloat, animationSpeed speed: CGFloat) -> SKFieldNodeParameters
- smoothness:
The smoothness of the noise used to generate the forces. This parameter should be a value between
0.0and1.0, where1.0represents a uniform smoothness. - speed:
The speed at which the noise field should change. A value of
0.0means that the field should not animate at all.
Return Value
A new noise field node.
Discussion
Use a noise field to simulate effects such as fireflies or snow.
The acceleration is proportional to the field strength in a pseudo-random direction. The calculated force is proportional to the physics body’s mass (meaning that the acceleration applied to all affected physics bodies is a constant).