parse static method

String parse(
  1. Scene object
)

Implementation

static String parse(Scene object){
    String output = '';
    int indexVertex = 0;
    int indexUvs = 0;
    int indexNormals = 0;

    output = "# Flutter OBJ File: \n";
	object.traverse((child){
		if(child is Mesh) {
        _OBJPM out = _parseMesh(child,indexVertex,indexUvs,indexNormals,true);
        output += out.file;
        indexVertex = out.indexVertex;
        indexUvs = out.indexUvs;
        indexNormals = out.indexNormals;
		}

		if(child is Line) {
			_OBJPM out = _parseLine(child,indexVertex);
        output += out.file;
        indexVertex = out.indexVertex;
		}

		if(child is Points) {
			_OBJPM out = _parsePoints(child,indexVertex);
        output += out.file;
        indexVertex = out.indexVertex;
		}
	});
	return output;
}