OBJLoader.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  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. return this;
  259. },
  260. parse: function ( text ) {
  261. console.time( 'OBJLoader' );
  262. var state = new ParserState();
  263. if ( text.indexOf( '\r\n' ) !== - 1 ) {
  264. // This is faster than String.split with regex that splits on both
  265. text = text.replace( /\r\n/g, '\n' );
  266. }
  267. if ( text.indexOf( '\\\n' ) !== - 1) {
  268. // join lines separated by a line continuation character (\)
  269. text = text.replace( /\\\n/g, '' );
  270. }
  271. var lines = text.split( '\n' );
  272. var line = '', lineFirstChar = '', lineSecondChar = '';
  273. var lineLength = 0;
  274. var result = [];
  275. // Faster to just trim left side of the line. Use if available.
  276. var trimLeft = ( typeof ''.trimLeft === 'function' );
  277. for ( var i = 0, l = lines.length; i < l; i ++ ) {
  278. line = lines[ i ];
  279. line = trimLeft ? line.trimLeft() : line.trim();
  280. lineLength = line.length;
  281. if ( lineLength === 0 ) continue;
  282. lineFirstChar = line.charAt( 0 );
  283. // @todo invoke passed in handler if any
  284. if ( lineFirstChar === '#' ) continue;
  285. if ( lineFirstChar === 'v' ) {
  286. lineSecondChar = line.charAt( 1 );
  287. if ( lineSecondChar === ' ' && ( result = vertex_pattern.exec( line ) ) !== null ) {
  288. // 0 1 2 3
  289. // ["v 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
  290. state.vertices.push(
  291. parseFloat( result[ 1 ] ),
  292. parseFloat( result[ 2 ] ),
  293. parseFloat( result[ 3 ] )
  294. );
  295. } else if ( lineSecondChar === 'n' && ( result = normal_pattern.exec( line ) ) !== null ) {
  296. // 0 1 2 3
  297. // ["vn 1.0 2.0 3.0", "1.0", "2.0", "3.0"]
  298. state.normals.push(
  299. parseFloat( result[ 1 ] ),
  300. parseFloat( result[ 2 ] ),
  301. parseFloat( result[ 3 ] )
  302. );
  303. } else if ( lineSecondChar === 't' && ( result = uv_pattern.exec( line ) ) !== null ) {
  304. // 0 1 2
  305. // ["vt 0.1 0.2", "0.1", "0.2"]
  306. state.uvs.push(
  307. parseFloat( result[ 1 ] ),
  308. parseFloat( result[ 2 ] )
  309. );
  310. } else {
  311. throw new Error( "Unexpected vertex/normal/uv line: '" + line + "'" );
  312. }
  313. } else if ( lineFirstChar === "f" ) {
  314. if ( ( result = face_vertex_uv_normal.exec( line ) ) !== null ) {
  315. // f vertex/uv/normal vertex/uv/normal vertex/uv/normal
  316. // 0 1 2 3 4 5 6 7 8 9 10 11 12
  317. // ["f 1/1/1 2/2/2 3/3/3", "1", "1", "1", "2", "2", "2", "3", "3", "3", undefined, undefined, undefined]
  318. state.addFace(
  319. result[ 1 ], result[ 4 ], result[ 7 ], result[ 10 ],
  320. result[ 2 ], result[ 5 ], result[ 8 ], result[ 11 ],
  321. result[ 3 ], result[ 6 ], result[ 9 ], result[ 12 ]
  322. );
  323. } else if ( ( result = face_vertex_uv.exec( line ) ) !== null ) {
  324. // f vertex/uv vertex/uv vertex/uv
  325. // 0 1 2 3 4 5 6 7 8
  326. // ["f 1/1 2/2 3/3", "1", "1", "2", "2", "3", "3", undefined, undefined]
  327. state.addFace(
  328. result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
  329. result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
  330. );
  331. } else if ( ( result = face_vertex_normal.exec( line ) ) !== null ) {
  332. // f vertex//normal vertex//normal vertex//normal
  333. // 0 1 2 3 4 5 6 7 8
  334. // ["f 1//1 2//2 3//3", "1", "1", "2", "2", "3", "3", undefined, undefined]
  335. state.addFace(
  336. result[ 1 ], result[ 3 ], result[ 5 ], result[ 7 ],
  337. undefined, undefined, undefined, undefined,
  338. result[ 2 ], result[ 4 ], result[ 6 ], result[ 8 ]
  339. );
  340. } else if ( ( result = face_vertex.exec( line ) ) !== null ) {
  341. // f vertex vertex vertex
  342. // 0 1 2 3 4
  343. // ["f 1 2 3", "1", "2", "3", undefined]
  344. state.addFace(
  345. result[ 1 ], result[ 2 ], result[ 3 ], result[ 4 ]
  346. );
  347. } else {
  348. throw new Error( "Unexpected face line: '" + line + "'" );
  349. }
  350. } else if ( lineFirstChar === "l" ) {
  351. var lineParts = line.substring( 1 ).trim().split( " " );
  352. var lineVertices = [], lineUVs = [];
  353. if ( line.indexOf( "/" ) === - 1 ) {
  354. lineVertices = lineParts;
  355. } else {
  356. for ( var li = 0, llen = lineParts.length; li < llen; li ++ ) {
  357. var parts = lineParts[ li ].split( "/" );
  358. if ( parts[ 0 ] !== "" ) lineVertices.push( parts[ 0 ] );
  359. if ( parts[ 1 ] !== "" ) lineUVs.push( parts[ 1 ] );
  360. }
  361. }
  362. state.addLineGeometry( lineVertices, lineUVs );
  363. } else if ( ( result = object_pattern.exec( line ) ) !== null ) {
  364. // o object_name
  365. // or
  366. // g group_name
  367. // WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869
  368. // var name = result[ 0 ].substr( 1 ).trim();
  369. var name = ( " " + result[ 0 ].substr( 1 ).trim() ).substr( 1 );
  370. state.startObject( name );
  371. } else if ( material_use_pattern.test( line ) ) {
  372. // material
  373. state.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );
  374. } else if ( material_library_pattern.test( line ) ) {
  375. // mtl file
  376. state.materialLibraries.push( line.substring( 7 ).trim() );
  377. } else if ( ( result = smoothing_pattern.exec( line ) ) !== null ) {
  378. // smooth shading
  379. // @todo Handle files that have varying smooth values for a set of faces inside one geometry,
  380. // but does not define a usemtl for each face set.
  381. // This should be detected and a dummy material created (later MultiMaterial and geometry groups).
  382. // This requires some care to not create extra material on each smooth value for "normal" obj files.
  383. // where explicit usemtl defines geometry groups.
  384. // Example asset: examples/models/obj/cerberus/Cerberus.obj
  385. var value = result[ 1 ].trim().toLowerCase();
  386. /*
  387. * http://paulbourke.net/dataformats/obj/
  388. * or
  389. * http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf
  390. *
  391. * From chapter "Grouping" Syntax explanation "s group_number":
  392. * "group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.
  393. * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form
  394. * surfaces, smoothing groups are either turned on or off; there is no difference between values greater
  395. * than 0."
  396. */
  397. state.object.smooth = ( value !== '0' && value !== 'off' );
  398. var material = state.object.currentMaterial();
  399. if ( material ) {
  400. material.smooth = state.object.smooth;
  401. }
  402. } else {
  403. // Handle null terminated files without exception
  404. if ( line === '\0' ) continue;
  405. throw new Error( "Unexpected line: '" + line + "'" );
  406. }
  407. }
  408. state.finalize();
  409. var container = new THREE.Group();
  410. container.materialLibraries = [].concat( state.materialLibraries );
  411. for ( var i = 0, l = state.objects.length; i < l; i ++ ) {
  412. var object = state.objects[ i ];
  413. var geometry = object.geometry;
  414. var materials = object.materials;
  415. var isLine = ( geometry.type === 'Line' );
  416. // Skip o/g line declarations that did not follow with any faces
  417. if ( geometry.vertices.length === 0 ) continue;
  418. var buffergeometry = new THREE.BufferGeometry();
  419. buffergeometry.addAttribute( 'position', new THREE.BufferAttribute( new Float32Array( geometry.vertices ), 3 ) );
  420. if ( geometry.normals.length > 0 ) {
  421. buffergeometry.addAttribute( 'normal', new THREE.BufferAttribute( new Float32Array( geometry.normals ), 3 ) );
  422. } else {
  423. buffergeometry.computeVertexNormals();
  424. }
  425. if ( geometry.uvs.length > 0 ) {
  426. buffergeometry.addAttribute( 'uv', new THREE.BufferAttribute( new Float32Array( geometry.uvs ), 2 ) );
  427. }
  428. // Create materials
  429. var createdMaterials = [];
  430. for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
  431. var sourceMaterial = materials[ mi ];
  432. var material = undefined;
  433. if ( this.materials !== null ) {
  434. material = this.materials.create( sourceMaterial.name );
  435. // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.
  436. if ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {
  437. var materialLine = new THREE.LineBasicMaterial();
  438. materialLine.copy( material );
  439. material = materialLine;
  440. }
  441. }
  442. if ( ! material ) {
  443. material = ( ! isLine ? new THREE.MeshPhongMaterial() : new THREE.LineBasicMaterial() );
  444. material.name = sourceMaterial.name;
  445. }
  446. material.flatShading = sourceMaterial.smooth ? false : true;
  447. createdMaterials.push(material);
  448. }
  449. // Create mesh
  450. var mesh;
  451. if ( createdMaterials.length > 1 ) {
  452. for ( var mi = 0, miLen = materials.length; mi < miLen ; mi++ ) {
  453. var sourceMaterial = materials[ mi ];
  454. buffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );
  455. }
  456. mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials ) : new THREE.LineSegments( buffergeometry, createdMaterials ) );
  457. } else {
  458. mesh = ( ! isLine ? new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] ) : new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] ) );
  459. }
  460. mesh.name = object.name;
  461. container.add( mesh );
  462. }
  463. console.timeEnd( 'OBJLoader' );
  464. return container;
  465. }
  466. };
  467. return OBJLoader;
  468. } )();