noiseField(smoothness:animationSpeed:)
Creates and returns a field behavior object that applies random noise to other forces.
Declaration
class func noiseField(smoothness: CGFloat, animationSpeed speed: CGFloat) -> SelfParameters
- smoothness:
The smoothness of the field. Specify a value between
0.0and1.0, where0.0indicates the maximum amount of randomness in the generated field and1.0indicates the least amount of randomness. - speed:
The frequency at which the noise field changes, measured in Hertz (Hz). Specify
0.0to create a noise field that does not change over time.
Return Value
A field behavior object that applies noise to other fields in the same area.
Discussion
A noise field creates a differentiable Perlin simplex noise field that varies over time. You can combine a noise field with other fields to add some variability to the behavior of those fields. The smoothness of the field defines how random the changes are from one point to the next point. A smooth field still adds noise but does so in a more predictable way. This field ignores the mass of the item.