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 == "ShapeGeometry") {
  //   return ShapeGeometry.fromJson(json, rootJson);
  // }
  // else if (type == "ExtrudeGeometry") {
  //   return ExtrudeGeometry.fromJson(json, rootJson);
  // }
  else {
    throw (" BufferGeometry castJson _type: $type is not support yet ");
  }
}