OBJLoader.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.OBJLoader = ( function () {
  5. // v float float float
  6. var vertex_pattern = /^v\s+([\d\.\+\-eE]+)\s+([\d\.\+\-eE]+)\s+([\d\.\+\-eE]+)/;
  7. // vn float float float
  8. var normal_pattern = /^vn\s+([\d\.\+\-eE]+)\s+([\d\.\+\-eE]+)\s+([\d\.\+\-eE]+)/;
  9. // vt float float
  10. var uv_pattern = /^vt\s+([\d\.\+\-eE]+)\s+([\d\.\+\-eE]+)/;
  11. // f vertex vertex vertex
  12. var face_vertex = /^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/;
  13. // f vertex/uv vertex/uv vertex/uv
  14. var face_vertex_uv = /^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/;
  15. // f vertex/uv/normal vertex/uv/normal vertex/uv/normal
  16. var face_vertex_uv_normal = /^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/;
  17. // f vertex//normal vertex//normal vertex//normal
  18. var face_vertex_normal = /^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/;
  19. // o object_name | g group_name
  20. var object_pattern = /^[og]\s*(.+)?/;
  21. // s boolean
  22. var smoothing_pattern = /^s\s+(\d+|on|off)/;
  23. // mtllib file_reference
  24. var material_library_pattern = /^mtllib /;
  25. // usemtl material_name
  26. var material_use_pattern = /^usemtl /;
  27. function ParserState() {
  28. var state = {
  29. objects : [],
  30. object : {},
  31. vertices : [],
  32. normals : [],
  33. uvs : [],
  34. materialLibraries : [],
  35. startObject: function ( name, fromDeclaration ) {
  36. // If the current object (initial from reset) is not from a g/o declaration in the parsed
  37. // file. We need to use it for the first parsed g/o to keep things in sync.
  38. if ( this.object && this.object.fromDeclaration === false ) {
  39. this.object.name = name;
  40. this.object.fromDeclaration = ( fromDeclaration !== false );
  41. return;
  42. }
  43. var previousMaterial = ( this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined );
  44. if ( this.object && typeof this.object._finalize === 'function' ) {
  45. this.object._finalize( true );
  46. }
  47. this.object = {
  48. name : name || '',
  49. fromDeclaration : ( fromDeclaration !== false ),
  50. geometry : {
  51. vertices : [],
  52. normals : [],
  53. uvs : []
  54. },
  55. materials : [],
  56. smooth : true,
  57. startMaterial : function( name, libraries ) {
  58. var previous = this._finalize( false );
  59. // New usemtl declaration overwrites an inherited material, except if faces were declared
  60. // after the material, then it must be preserved for proper MultiMaterial continuation.
  61. if ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {
  62. this.materials.splice( previous.index, 1 );
  63. }
  64. var material = {
  65. index : this.materials.length,
  66. name : name || '',
  67. mtllib : ( Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '' ),
  68. smooth : ( previous !== undefined ? previous.smooth : this.smooth ),
  69. groupStart : ( previous !== undefined ? previous.groupEnd : 0 ),
  70. groupEnd : -1,
  71. groupCount : -1,
  72. inherited : false,
  73. clone : function( index ) {
  74. var cloned = {
  75. index : ( typeof index === 'number' ? index : this.index ),
  76. name : this.name,
  77. mtllib : this.mtllib,
  78. smooth : this.smooth,
  79. groupStart : 0,
  80. groupEnd : -1,
  81. groupCount : -1,
  82. inherited : false
  83. };
  84. cloned.clone = this.clone.bind(cloned);
  85. return cloned;
  86. }
  87. };
  88. this.materials.push( material );
  89. return material;
  90. },
  91. currentMaterial : function() {
  92. if ( this.materials.length > 0 ) {
  93. return this.materials[ this.materials.length - 1 ];
  94. }
  95. return undefined;
  96. },
  97. _finalize : function( end ) {
  98. var lastMultiMaterial = this.currentMaterial();
  99. if ( lastMultiMaterial && lastMultiMaterial.groupEnd === -1 ) {
  100. lastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;
  101. lastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;
  102. lastMultiMaterial.inherited = false;
  103. }
  104. // Ignore objects tail materials if no face declarations followed them before a new o/g started.
  105. if ( end && this.materials.length > 1 ) {
  106. for ( var mi = this.materials.length - 1; mi >= 0; mi-- ) {
  107. if ( this.materials[ mi ].groupCount <= 0 ) {
  108. this.materials.splice( mi, 1 );
  109. }
  110. }
  111. }
  112. // Guarantee at least one empty material, this makes the creation later more straight forward.
  113. if ( end && this.materials.length === 0 ) {
  114. this.materials.push({
  115. name : '',
  116. smooth : this.smooth
  117. });
  118. }
  119. return lastMultiMaterial;
  120. }
  121. };
  122. // Inherit previous objects material.
  123. // Spec tells us that a declared material must be set to all objects until a new material is declared.
  124. // If a usemtl declaration is encountered while this new object is being parsed, it will
  125. // overwrite the inherited material. Exception being that there was already face declarations
  126. // to the inherited material, then it will be preserved for proper MultiMaterial continuation.
  127. if ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === "function" ) {
  128. var declared = previousMaterial.clone( 0 );
  129. declared.inherited = true;
  130. this.object.materials.push( declared );
  131. }
  132. this.objects.push( this.object );
  133. },
  134. finalize : function() {
  135. if ( this.object && typeof this.object._finalize === 'function' ) {
  136. this.object._finalize( true );
  137. }
  138. },
  139. parseVertexIndex: function ( value, len ) {
  140. var index = parseInt( value, 10 );
  141. return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
  142. },
  143. parseNormalIndex: function ( value, len ) {
  144. var index = parseInt( value, 10 );
  145. return ( index >= 0 ? index - 1 : index + len / 3 ) * 3;
  146. },
  147. parseUVIndex: function ( value, len ) {
  148. var index = parseInt( value, 10 );
  149. return ( index >= 0 ? index - 1 : index + len / 2 ) * 2;
  150. },
  151. addVertex: function ( a, b, c ) {
  152. var src = this.vertices;
  153. var dst = this.object.geometry.vertices;
  154. dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
  155. dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );
  156. dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );
  157. },
  158. addVertexLine: function ( a ) {
  159. var src = this.vertices;
  160. var dst = this.object.geometry.vertices;
  161. dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
  162. },
  163. addNormal : function ( a, b, c ) {
  164. var src = this.normals;
  165. var dst = this.object.geometry.normals;
  166. dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );
  167. dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );
  168. dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );
  169. },
  170. addUV: function ( a, b, c ) {
  171. var src = this.uvs;
  172. var dst = this.object.geometry.uvs;
  173. dst.push( src[ a + 0 ], src[ a + 1 ] );
  174. dst.push( src[ b + 0 ], src[ b + 1 ] );
  175. dst.push( src[ c + 0 ], src[ c + 1 ] );
  176. },
  177. addUVLine: function ( a ) {
  178. var src = this.uvs;
  179. var dst = this.object.geometry.uvs;
  180. dst.push( src[ a + 0 ], src[ a + 1 ] );
  181. },
  182. addFace: function ( a, b, c, d, ua, ub, uc, ud, na, nb, nc, nd ) {
  183. var vLen = this.vertices.length;
  184. var ia = this.parseVertexIndex( a, vLen );
  185. var ib = this.parseVertexIndex( b, vLen );
  186. var ic = this.parseVertexIndex( c, vLen );
  187. var id;
  188. if ( d === undefined ) {
  189. this.addVertex( ia, ib, ic );
  190. } else {
  191. id = this.parseVertexIndex( d, vLen );
  192. this.addVertex( ia, ib, id );
  193. this.addVertex( ib, ic, id );
  194. }
  195. if ( ua !== undefined ) {
  196. var uvLen = this.uvs.length;
  197. ia = this.parseUVIndex( ua, uvLen );
  198. ib = this.parseUVIndex( ub, uvLen );
  199. ic = this.parseUVIndex( uc, uvLen );
  200. if ( d === undefined ) {
  201. this.addUV( ia, ib, ic );
  202. } else {
  203. id = this.parseUVIndex( ud, uvLen );
  204. this.addUV( ia, ib, id );
  205. this.addUV( ib, ic, id );
  206. }
  207. }
  208. if ( na !== undefined ) {
  209. // Normals are many times the same. If so, skip function call and parseInt.
  210. var nLen = this.normals.length;
  211. ia = this.parseNormalIndex( na, nLen );
  212. ib = na === nb ? ia : this.parseNormalIndex( nb, nLen );
  213. ic = na === nc ? ia : this.parseNormalIndex( nc, nLen );
  214. if ( d === undefined ) {
  215. this.addNormal( ia, ib, ic );
  216. } else {
  217. id = this.parseNormalIndex( nd, nLen );
  218. this.addNormal( ia, ib, id );
  219. this.addNormal( ib, ic, id );
  220. }
  221. }
  222. },
  223. addLineGeometry: function ( vertices, uvs ) {
  224. this.object.geometry.type = 'Line';
  225. var vLen = this.vertices.length;
  226. var uvLen = this.uvs.length;
  227. for ( var vi = 0, l = vertices.length; vi < l; vi ++ ) {
  228. this.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );
  229. }
  230. for ( var uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {
  231. this.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );
  232. }
  233. }
  234. };
  235. state.startObject( '', false );
  236. return state;
  237. }
  238. //
  239. function OBJLoader( manager ) {
  240. this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager;
  241. this.materials = null;
  242. };
  243. OBJLoader.prototype = {
  244. constructor: OBJLoader,
  245. load: function ( url, onLoad, onProgress, onError ) {
  246. var scope = this;
  247. var loader = new THREE.FileLoader( scope.manager );
  248. loader.setPath( this.path );
  249. loader.load( url, function ( text ) {
  250. onLoad( scope.parse( text ) );
  251. }, onProgress, onError );
  252. },
  253. setPath: function ( value ) {
  254. this.path = value;
  255. },
  256. setMaterials: function ( materials ) {
  257. this.materials = materials;
  258. },
  259. parse: function ( text ) {
  260. console.time( 'OBJLoader' );
  261. var state = new ParserState();
  262. if ( text.indexOf( '\r\n' ) !== - 1 ) {
  263. // This is faster than String.split with regex that splits on both
  264. text = text.replace( /\r\n/g, '\n' );
  265. }
  266. if ( text.indexOf( '\\\n' ) !== - 1) {
  267. // join lines separated by a line continuation character (\)
  268. text = text.replace( /\\\n/g, '' );
  269. }
  270. var lines = text.split( '\n' );
  271. var line = '', lineFirstChar = '', lineSecondChar = '';
  272. var lineLength = 0;
  273. var result = [];
  274. // Faster to just trim left side of the line. Use if available.
  275. var trimLeft = ( typeof ''.trimLeft === 'function' );
  276. for ( var i = 0, l = lines.length; i < l; i ++ ) {
  277. line = lines[ i ];
  278. line = trimLeft ? line.trimLeft() : line.trim();
  279. lineLength = line.length;
  280. if ( lineLength === 0 ) continue;
  281. lineFirstChar = line.charAt( 0 );
  282. // @todo invoke passed in handler if any
  283. if ( lineFirstChar === '#' ) continue;
  284. if ( lineFirstChar === 'v' ) {
  285. lineSecondChar = line.charAt( 1 );
  286. if ( lineSecondChar === ' ' && ( result = vertex_pattern.exec( line ) ) !== null ) {
  287. // 0 1 2 3
  288. // ["v 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
  289. state.vertices.push(
  290. parseFloat( result[ 1 ] ),
  291. parseFloat( result[ 2 ] ),
  292. parseFloat( result[ 3 ] )
  293. );
  294. } else if ( lineSecondChar === 'n' && ( result = normal_pattern.exec( line ) ) !== null ) {
  295. // 0 1 2 3
  296. // ["vn 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
  297. state.normals.push(
  298. parseFloat( result[ 1 ] ),
  299. parseFloat( result[ 2 ] ),
  300. parseFloat( result[ 3 ] )
  301. );
  302. } else if ( lineSecondChar === 't' && ( result = uv_pattern.exec( line ) ) !== null ) {
  303. // 0 1 2
  304. // ["vt 0.1 0.2", "0.1", "0.2"]
  305. state.uvs.push(
  306. parseFloat( result[ 1 ] ),
  307. parseFloat( result[ 2 ] )
  308. );
  309. } else {
  310. throw new Error( "Unexpected vertex/normal/uv line: '" + line + "'" );
  311. }
  312. } else if ( lineFirstChar === "f" ) {
  313. if ( ( result = face_vertex_uv_normal.exec( line ) ) !== null ) {
  314. // f vertex/uv/normal vertex/uv/normal vertex/uv/normal
  315. // 0 1 2 3 4 5 6 7 8 9 10 11 12
  316. // ["f 1/1/1 2/2/2 3/3/3", "1", "1", "1", "2", "2", "2", "3", "3", "3", undefined, undefined, undefined]
  317. state.addFace(
  318. result[ 1 ], result[ 4 ], result[ 7 ], result[ 10 ],
  319. result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ],
  320. result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ]
  321. );
  322. } else if ( ( result = face_vertex_uv.exec( line ) ) !== null ) {
  323. // f vertex/uv vertex/uv vertex/uv
  324. // 0 1 2 3 4 5 6 7 8
  325. // ["f 1/1 2/2 3/3", "1", "1", "2", "2", "3", "3", undefined, undefined]
  326. state.addFace(
  327. result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
  328. result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
  329. );
  330. } else if ( ( result = face_vertex_normal.exec( line ) ) !== null ) {
  331. // f vertex//normal vertex//normal vertex//normal
  332. // 0 1 2 3 4 5 6 7 8
  333. // ["f 1//1 2//2 3//3", "1", "1", "2", "2", "3", "3", undefined, undefined]
  334. state.addFace(
  335. result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
  336. undefined, undefined, undefined, undefined,
  337. result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
  338. );
  339. } else if ( ( result = face_vertex.exec( line ) ) !== null ) {
  340. // f vertex vertex vertex
  341. // 0 1 2 3 4
  342. // ["f 1 2 3", "1", "2", "3", undefined]
  343. state.addFace(
  344. result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ]
  345. );
  346. } else {
  347. throw new Error( "Unexpected face line: '" + line + "'" );
  348. }
  349. } else if ( lineFirstChar === "l" ) {
  350. var lineParts = line.substring( 1 ).trim().split( " " );
  351. var lineVertices = [], lineUVs = [];
  352. if ( line.indexOf( "/" ) === - 1 ) {
  353. lineVertices = lineParts;
  354. } else {
  355. for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {
  356. var parts = lineParts[ li ].split( "/" );
  357. if ( parts[ 0 ] !== "" ) lineVertices.push( parts[ 0 ] );
  358. if ( parts[ 1 ] !== "" ) lineUVs.push( parts[ 1 ] );
  359. }
  360. }
  361. state.addLineGeometry( lineVertices, lineUVs );
  362. } else if ( ( result = object_pattern.exec( line ) ) !== null ) {
  363. // o object_name
  364. // or
  365. // g group_name
  366. // WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
  367. // var name = result[ 0 ].substr( 1 ).trim();
  368. var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
  369. state.startObject( name );
  370. } else if ( material_use_pattern.test( line ) ) {
  371. // material
  372. state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );
  373. } else if ( material_library_pattern.test( line ) ) {
  374. // mtl file
  375. state.materialLibraries.push( line.substring( 7 ).trim() );
  376. } else if ( ( result = smoothing_pattern.exec( line ) ) !== null ) {
  377. // smooth shading
  378. // @todo Handle files that have varying smooth values for a set of faces inside one geometry,
  379. // but does not define a usemtl for each face set.
  380. // This should be detected and a dummy material created (later MultiMaterial and geometry groups).
  381. // This requires some care to not create extra material on each smooth value for "normal" obj files.
  382. // where explicit usemtl defines geometry groups.
  383. // Example asset: examples/models/obj/cerberus/Cerberus.obj
  384. var value = result[ 1 ].trim().toLowerCase();
  385. /*
  386. * http://paulbourke.net/dataformats/obj/
  387. * or
  388. * http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf
  389. *
  390. * From chapter "Grouping" Syntax explanation "s group_number":
  391. * "group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.
  392. * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form
  393. * surfaces, smoothing groups are either turned on or off; there is no difference between values greater
  394. * than 0."
  395. */
  396. state.object.smooth = ( value !== '0' && value !== 'off' );
  397. var material = state.object.currentMaterial();
  398. if ( material ) {
  399. material.smooth = state.object.smooth;
  400. }
  401. } else {
  402. // Handle null terminated files without exception
  403. if ( line === '\0' ) continue;
  404. throw new Error( "Unexpected line: '" + line + "'" );
  405. }
  406. }
  407. state.finalize();
  408. var container = new THREE.Group();
  409. container.materialLibraries = [].concat( state.materialLibraries );
  410. for ( var i = 0, l = state.objects.length; i < l; i ++ ) {
  411. var object = state.objects[ i ];
  412. var geometry = object.geometry;
  413. var materials = object.materials;
  414. var isLine = ( geometry.type === 'Line' );
  415. // Skip o/g line declarations that did not follow with any faces
  416. if ( geometry.vertices.length === 0 ) continue;
  417. var buffergeometry = new THREE.BufferGeometry();
  418. buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );
  419. if ( geometry.normals.length > 0 ) {
  420. buffergeometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( geometry.normals ), 3 ) );
  421. } else {
  422. buffergeometry.computeVertexNormals();
  423. }
  424. if ( geometry.uvs.length > 0 ) {
  425. buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );
  426. }
  427. // Create materials
  428. var createdMaterials = [];
  429. for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
  430. var sourceMaterial = materials[ mi ];
  431. var material = undefined;
  432. if ( this.materials !== null ) {
  433. material = this.materials.create( sourceMaterial.name );
  434. // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.
  435. if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {
  436. var materialLine = new THREE.LineBasicMaterial();
  437. materialLine.copy( material );
  438. material = materialLine;
  439. }
  440. }
  441. if ( ! material ) {
  442. material = ( ! isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial() );
  443. material.name = sourceMaterial.name;
  444. }
  445. material.flatShading = sourceMaterial.smooth ? false : true;
  446. createdMaterials.push(material);
  447. }
  448. // Create mesh
  449. var mesh;
  450. if ( createdMaterials.length > 1 ) {
  451. for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
  452. var sourceMaterial = materials[ mi ];
  453. buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );
  454. }
  455. mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials ) : new THREE.LineSegments( buffergeometry, createdMaterials ) );
  456. } else {
  457. mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ) : new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ) );
  458. }
  459. mesh.name = object.name;
  460. container.add( mesh );
  461. }
  462. console.timeEnd( 'OBJLoader' );
  463. return container;
  464. }
  465. };
  466. return OBJLoader;
  467. } )();