According to the SceneKit API, euler angles, as a property of SCNNode, are SCNVector3. And SCNVector3 is { CGFloat x, y, z: }
. But when I attempt to assign a CGFloat to a eulerAngle property of a node, Xcode claims I'm trying to assign to type 'Float'. Here's a snippet from my panGesture
handler:
baseNode.eulerAngles.x = newAngleX
I can avoid this by casting as Floats but I'm curious, especially since SCNVector3 still seems to accept CGFloats.
You're right, the documentation is wrong. Directly from SceneKit/SceneKitTypes.h:
Which, amongst other things, means they're 32-bit regardless of target, unlike
CGFloat
s. So it's not a mere typedef issue despite the naming similarity — Swift is right to want an explicit cast.