I'm still very new to SceneKit and SpriteKit and just started working on animating some SCNNodes.
One thing I don't get is when to use SCNAction and when to use CABasicAnimation. Is there any performance difference between SCNAction and CABasicAnimation?
For animating SceneKit's content you can use at least four approaches: implicit animations, explicit animations, actions, and dynamics. Let's explore what is what.
Watch WWDC 2012 SceneKit Session 504. Time 28:40.
SCNAction is a simple, reusable animation that changes attributes of any node you attach it to. You can use as many
SCNActionsper object as you wish. Perceive it as the simplest animation's building block for much complicated animation, containing severalSCNActionsfor one 3D object.SCNTransaction is a mechanism for creating implicit animations and combining scene graph changes into atomic updates.
or
CAAnimation is an abstract superclass for explicit animation in Core Animation. You can use the properties of the CAAnimation object representing a geometry animation to control its timing, monitor its progress, and attach actions for SceneKit to trigger during the animation.
Physics Simulation adds dynamic behaviors to scene elements, detect contacts and collisions, simulate realistic effects like gravity, springs and vehicles.