Instance Property

particleBounce

The restitution coefficient of each particle in the system. Animatable.

Declaration

var particleBounce: CGFloat { get set }

Discussion

Restitution determines the amount of energy gained or lost in a collision. (To define collision behavior, see the colliderNodes property.)

A value of 1.0 specifies that a particle loses no energy in a collision (for example, a particle that falls from a certain height onto a flat surface bounces back to the same height). Larger values specify energy gained, and smaller values specify a loss of energy. A value of 0.0 prevents particles from bouncing. You can randomize the bounce factors of particles in the system with the particleBounceVariation property.

The default value is 0.7.

You can animate changes to this property’s value. See Animating SceneKit Content.

See Also

Simulating Physics for Particles

var isAffectedByGravity: Bool

A Boolean value that determines whether gravity, as defined by the scene’s physics simulation, affects the motion of particles.

var isAffectedByPhysicsFields: Bool

A Boolean value that determines whether physics fields in the scene affect the motion of particles.

var colliderNodes: [SCNNode]?

The nodes whose geometry the system’s particles can collide with.

var particleDiesOnCollision: Bool

A Boolean value that determines whether particles are removed from the scene upon colliding with another object.

var acceleration: SCNVector3

The constant acceleration vector, in units per second per second, applied to all particles in the system. Animatable.

var dampingFactor: CGFloat

A factor that slows particles relative to their velocity. Animatable.

var particleMass: CGFloat

The mass, in kilograms, of each particle in the system. Animatable.

var particleMassVariation: CGFloat

The range, in kilograms, of randomized particle masses. Animatable.

var particleCharge: CGFloat

The electric charge, in coulombs, of each particle in the system. Animatable.

var particleChargeVariation: CGFloat

The range, in coulombs, of randomized particle charges. Animatable.

var particleBounceVariation: CGFloat

The range of randomized restitution coefficients for particles. Animatable.

var particleFriction: CGFloat

The friction coefficient of each particle in the system. Animatable.

var particleFrictionVariation: CGFloat

The range of randomized friction coefficients for particles. Animatable.