The signature for a block that SceneKit calls to determine the effect of a custom field on an object.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
You use this type of block to create a custom physics field with the
custom method. SceneKit calls your block once for each object in the field’s area of effect, on each step of the physics simulation.
The block takes the following parameters:
The position of the object affected by the field, in the local coordinate space of the node containing the field.
The velocity of the object affected by the field, relative to the local coordinate space of the node containing the field.
The elapsed time, in seconds, since the last simulation step.
Your block uses these parameters to compute and return an
SCNVector3 force vector, which SceneKit then applies to the object affected by the field.