public static AccessorSparse Deserialize(GLTFRoot root, JsonReader reader) { var accessorSparse = new AccessorSparse(); while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "count": accessorSparse.Count = reader.ReadAsInt32().Value; break; case "indices": accessorSparse.Indices = AccessorSparseIndices.Deserialize(root, reader); break; case "values": accessorSparse.Values = AccessorSparseValues.Deserialize(root, reader); break; default: accessorSparse.DefaultPropertyDeserializer(root, reader); break; } } return(accessorSparse); }
public static AccessorSparseIndices Deserialize(GLTFRoot root, JsonReader reader) { var indices = new AccessorSparseIndices(); while (reader.Read() && reader.TokenType == JsonToken.PropertyName) { var curProp = reader.Value.ToString(); switch (curProp) { case "bufferView": indices.BufferView = BufferViewId.Deserialize(root, reader); break; case "byteOffset": indices.ByteOffset = reader.ReadAsInt32().Value; break; case "componentType": indices.ComponentType = (GLTFComponentType)reader.ReadAsInt32().Value; break; default: indices.DefaultPropertyDeserializer(root, reader); break; } } return(indices); }
public AccessorSparse(AccessorSparse accessorSparse, GLTFRoot gltfRoot) : base(accessorSparse) { if (accessorSparse == null) { return; } Count = accessorSparse.Count; Indices = new AccessorSparseIndices(accessorSparse.Indices, gltfRoot); Values = new AccessorSparseValues(accessorSparse.Values, gltfRoot); }
public AccessorSparseIndices(AccessorSparseIndices accessorSparseIndices, GLTFRoot gltfRoot) : base(accessorSparseIndices) { if (accessorSparseIndices == null) { return; } BufferView = new BufferViewId(accessorSparseIndices.BufferView, gltfRoot); ByteOffset = accessorSparseIndices.ByteOffset; ComponentType = accessorSparseIndices.ComponentType; }