Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNPhysicsFieldMBS class.

SCNPhysicsFieldMBS.SCNFieldForceEvaluatorMBS(position as SCNVector3MBS, velocity as SCNVector3MBS, mass as single, charge as single, time as double, Tag as Variant) as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
delegate SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The signature for a delegate that SceneKit calls to determine the effect of a custom field on an object.

You use this type of delegate to create a custom physics field with the customFieldWithEvaluationBlock: method. SceneKit calls your delegate once for each object in the field’s area of effect, on each step of the physics simulation.

Note
By default, one simulation step occurs for each frame rendered. For example, if your view renders at 60 frames per second and three bodies are in the field’s area of effect, SceneKit runs your delegate 180 times per second. To avoid reduced rendering performance, take care not to perform extensive computation in this delegate.
The delegate takes the following parameters:

position: The position of the object affected by the field, in the local coordinate space of the node containing the field.
velocity: The velocity of the object affected by the field, relative to the local coordinate space of the node containing the field.
mass: The mass of the object affected by the field. (See the mass property for physics bodies and the particleMass property for particle systems.)
charge: The electrical charge of the object affected by the field. (See the charge property for physics bodies and the particleCharge property for particle systems.)
time: The elapsed time, in seconds, since the last simulation step.

Your delegate uses these parameters to compute and return an SCNVector3 force vector, which SceneKit then applies to the object affected by the field.

Some methods using this delegate:

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...