castJSON static method

BufferGeometry castJSON(
  1. Map<String, dynamic> json,
  2. Map<String, dynamic> rootJSON
)

Implementation

static BufferGeometry castJSON(Map<String, dynamic> json, Map<String, dynamic> rootJSON) {
  String type = json["type"];

  if (type == "BufferGeometry") {
    return BufferGeometry.fromJSON(json, rootJSON);
  } else if (type == "ShapeBufferGeometry") {
    return ShapeGeometry.fromJSON(json, rootJSON);
  } else if (type == "ExtrudeBufferGeometry") {
    return ExtrudeGeometry.fromJSON(json, rootJSON);
  } else {
    throw (" BufferGeometry castJSON _type: $type is not support yet ");
  }
}