Custom (de)serialization for vector, matrix, quaternion