add matrix and quaternion