How can I get the rotation of a SCNNode to use it as ZRotation in SpriteKit?

I'm trying to get a SCNNode rotation in ARKit (SCNVector4) and send this rotation to SpriteKit (ZRotation, only one value). Do we have a way to get this value? Am I missing some kind of formula?

Replies

The SCNVector4 rotation gives you a quaternion, to get the rotation angle from the quaternion, take `2 * acos(node.rotation.w)`