Instance Property

inputProperty

A particle property that provides input values for this property controller’s animation.

Declaration

@property(nonatomic, copy) SCNParticleProperty inputProperty;

Discussion

This property applies only when the controller’s inputMode value is SCNParticleInputModeOverOtherProperty.

Use this option to animate one property in response to changes in one of each particle’s other properties. For example, the following code animates particles’ size as a function of their velocity, causing particles to become larger when they move faster:

CABasicAnimation *animation = [CABasicAnimation animation];
animation.fromValue = @0.1;
animation.toValue = @10.0;
 
SCNParticlePropertyController *sizeController =
    [SCNParticlePropertyController controllerWithAnimation:animation];
sizeController.inputMode = SCNParticleInputModeOverOtherProperty;
sizeController.inputProperty = SCNParticlePropertyVelocity;
sizeController.inputScale = 0.1;
 
particleSystem.propertyControllers = @{ SCNParticlePropertySize : sizeController };

To refine the relationship between a range of property values and a range of input values for the controller’s animation, use the inputBias and inputScale properties.

If you specify a vector property (such as acceleration) as the input property, SceneKit uses that vector’s length for the input value.

See Also

Managing the Controller’s Animation

animation

The Core Animation object defining the behavior of the property animation.

inputMode

The mode that determines input values for the property controller’s animation.

inputBias

An offset to add to the input value of the controller’s animation.

inputScale

A factor for multiplying the input value of the controller’s animation.

inputOrigin

A node whose distance to each particle provides input values for the controller’s animation.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software