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 ");
  }
}