Instance Property

affectedByGravity

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

Declaration

@property(nonatomic) BOOL affectedByGravity;

Discussion

Gravity applies a constant acceleration to all particles in the system. SceneKit offers two options for simulating the effect of gravity on particles:

  • The affectedByGravity property, which uses the gravity vector specified by the physicsWorld object of the scene containing the particle system. Use this option when you want the system’s particles to be affected by the same gravity as the SCNPhysicsBody objects in your scene.

  • The acceleration property, which is independent of the simulation SceneKit uses for physics bodies in the scene. Use acceleration to simulate gravity if you have no SCNPhysicsBody objects in your scene, or if you want particles to be affected both by the physics world’s gravity and another constant acceleration (such as wind).

The default value is NO, specifying that the physics world’s gravity does not affect particles.

See Also

Simulating Physics for Particles

affectedByPhysicsFields

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

colliderNodes

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

particleDiesOnCollision

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

acceleration

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

dampingFactor

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

particleMass

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

particleMassVariation

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

particleCharge

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

particleChargeVariation

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

particleBounce

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

particleBounceVariation

The range of randomized restitution coefficients for particles. Animatable.

particleFriction

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

particleFrictionVariation

The range of randomized friction coefficients for particles. Animatable.