toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  Map<String, dynamic> result = {
    "itemSize": itemSize,
    "type": array.runtimeType.toString(), //.replaceAll('List', 'Array'),
    "array": array.sublist(0),
    "normalized": normalized
  };

  if (name != null) result["name"] = name;
  if (usage != StaticDrawUsage) result["usage"] = usage;
  if (updateRange?["offset"] != 0 || updateRange?["count"] != -1) {
    result["updateRange"] = updateRange;
  }

  return result;
}