Unfortunately, no at the moment. Most likely, the hidden API call that Apple uses to convert through CALayers and OpenGL, but at the moment this is the best choice. I would just make a utility class that contains this in it.
- (GLKMatrix4)matrixFrom3DTransformation:(CATransform3D)transform { GLKMatrix4 matrix = GLKMatrix4Make(transform.m11, transform.m12, transform.m13, transform.m14, transform.m21, transform.m22, transform.m23, transform.m24, transform.m31, transform.m32, transform.m33, transform.m34, transform.m41, transform.m42, transform.m43, transform.m44); return matrix; }
Using something like
CALayer *layer = [CALayer layer]; CATransform3D transform = layer.transform; GLKMatrix4 matrix4 = *(GLKMatrix4 *)&transform;
The punning type is called. If you do not understand how this works, you should not use it. You cannot type CATransform3D on GLKMatrix4 because their data structures are different in memory.
reference link: punning type
GLKMatrix4
union _GLKMatrix4 { struct { float m00, m01, m02, m03; float m10, m11, m12, m13; float m20, m21, m22, m23; float m30, m31, m32, m33; }; float m[16]; } typedef union _GLKMatrix4 GLKMatrix4;
CATransform3D
struct CATransform3D { CGFloat m11, m12, m13, m14; CGFloat m21, m22, m23, m24; CGFloat m31, m32, m33, m34; CGFloat m41, m42, m43, m44; }; typedef struct CATransform3D CATransform3D;