fromJSON method

MeshGeometry fromJSON(
  1. Map<String, dynamic> json
)

Restores this instance from the given JSON object.

Implementation

MeshGeometry fromJSON(Map<String,dynamic> json ) {
	aabb = AABB().fromJSON( json['aabb'] );
	boundingSphere = BoundingSphere().fromJSON( json['boundingSphere'] );
	backfaceCulling = json['backfaceCulling'];

	vertices = Float32List.fromList( json['vertices'] );

	switch ( json['indices']['type'] ) {
		case 'Uint16Array':
			indices = Uint16List( json['indices']['data'] );
			break;
		case 'Uint32Array':
			indices = Uint32List( json['indices']['data'] );
			break;
		case 'null':
			indices = null;
			break;
	}

	return this;
}