parse method

dynamic parse(
  1. dynamic FBXBuffer, [
  2. String? path,
  3. Function? onLoad,
  4. Function? onError,
])
override

Implementation

parse( FBXBuffer, [String? path, Function? onLoad, Function? onError] ) {

	if ( isFbxFormatBinary( FBXBuffer ) ) {

		fbxTree = new BinaryParser().parse( FBXBuffer );

	} else {

		var FBXText = convertArrayBufferToString( FBXBuffer );

		if ( ! isFbxFormatASCII( FBXText ) ) {

			throw( 'THREE.FBXLoader: Unknown format.' );

		}

		if ( getFbxVersion( FBXText ) < 7000 ) {

			throw( 'THREE.FBXLoader: FBX version not supported, FileVersion: ' + getFbxVersion( FBXText ) );

		}

		fbxTree = new TextParser().parse( FBXText );

	}

	// console.log( fbxTree );

	var textureLoader = new TextureLoader( this.manager ).setPath( (this.resourcePath == '' || this.resourcePath == null) ? path : '').setCrossOrigin( this.crossOrigin );

	return new FBXTreeParser( textureLoader, this.manager, this.innerWidth, this.innerHeight ).parse( );

}