public static Node Deserialize(GLTFRoot root, JsonReader reader) { var node = new Node(); while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "camera": node.Camera = CameraId.Deserialize(root, reader); break; case "children": node.Children = NodeId.ReadList(root, reader); break; case "skin": node.Skin = SkinId.Deserialize(root, reader); break; case "matrix": var list = reader.ReadDoubleList(); // gltf has column ordered matricies var mat = new Matrix4x4( (float)list[0], (float)list[1], (float)list[2], (float)list[3], (float)list[4], (float)list[5], (float)list[6], (float)list[7], (float)list[8], (float)list[9], (float)list[10], (float)list[11], (float)list[12], (float)list[13], (float)list[14], (float)list[15] ); node.Matrix = mat; break; case "mesh": node.Mesh = MeshId.Deserialize(root, reader); break; case "rotation": node.UseTRS = true; node.Rotation = reader.ReadAsQuaternion(); break; case "scale": node.UseTRS = true; node.Scale = reader.ReadAsVector3(); break; case "translation": node.UseTRS = true; node.Translation = reader.ReadAsVector3(); break; case "weights": node.Weights = reader.ReadDoubleList(); break; default: node.DefaultPropertyDeserializer(root, reader); break; } } return(node); }