Loader.html 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  6. <script src="../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <div class="desc">Base class for implementing loaders.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]()</h3>
  14. <div>
  15. Creates a new [name]. This should be called as base class.
  16. </div>
  17. <h2>Properties</h2>
  18. <h3>[property:Function onLoadStart]</h3>
  19. <div>Will be called when load starts.</div>
  20. <div>The default is a function with empty body.</div>
  21. <h3>[property:Function onLoadProgress]</h3>
  22. <div>Will be called while load progresses.</div>
  23. <div>The default is a function with empty body.</div>
  24. <h3>[property:Function onLoadComplete]</h3>
  25. <div>Will be called when load completes.</div>
  26. <div>The default is a function with empty body.</div>
  27. <h3>[property:string crossOrigin]</h3>
  28. <div>
  29. The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
  30. </div>
  31. <h2>Methods</h2>
  32. <h3>[method:Boolean needsTangents]( [page:Array materials] )</h3>
  33. <div>
  34. [page:Array materials] — an array of [page:Material]
  35. </div>
  36. <div>
  37. Checks if the loaded object needs tangents based on its materials.
  38. </div>
  39. <h3>[method:Material createMaterial]( [page:object m], [page:string texturePath] )</h3>
  40. <div>
  41. [page:Object m] — The parameters to create the material. <br />
  42. [page:String texturePath] — The base path of the textures.
  43. </div>
  44. <div>
  45. Creates the Material based on the parameters m.
  46. </div>
  47. <h3>[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )</h3>
  48. <div>
  49. [page:Array materials] — an array of parameters to create materials. <br />
  50. [page:String texturePath] — The base path of the textures.
  51. </div>
  52. <div>
  53. Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials.
  54. </div>
  55. <h3>[method:String extractUrlBase]( [page:string url] )</h3>
  56. <div>
  57. [page:String url] — The url to extract the base url from.
  58. </div>
  59. <div>
  60. Extract the base from the URL.
  61. </div>
  62. <h3>[method:DOMElement addStatusElement]()</h3>
  63. <div>
  64. Add a DOM element to indicate the progress and return the DOMElement
  65. </div>
  66. <h2>Source</h2>
  67. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  68. </body>
  69. </html>