Loader.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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]( [page:Boolean showStatus] )</h3>
  14. <div>
  15. [page:Boolean showStatus] — Show the status of loading div.
  16. </div>
  17. <div>
  18. Creates a new [name]. This should be called as base class.
  19. </div>
  20. <h2>Properties</h2>
  21. <h3>[property:Boolean showStatus]</h3>
  22. <div>If true, show loading status in the statusDomElement.</div>
  23. <h3>[property:DOMElement statusDomElement]</h3>
  24. <div>This is the recipient of status messages.</div>
  25. <h3>[property:Function onLoadStart]</h3>
  26. <div>Will be called when load starts.</div>
  27. <div>The default is a function with empty body.</div>
  28. <h3>[property:Function onLoadProgress]</h3>
  29. <div>Will be called while load progresses.</div>
  30. <div>The default is a function with empty body.</div>
  31. <h3>[property:Function onLoadComplete]</h3>
  32. <div>Will be called when load completes.</div>
  33. <div>The default is a function with empty body.</div>
  34. <h3>[property:string crossOrigin]</h3>
  35. <div>
  36. The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
  37. </div>
  38. <h2>Methods</h2>
  39. <h3>[method:Boolean needsTangents]( [page:Array materials] )</h3>
  40. <div>
  41. [page:Array materials] — an array of [page:Material]
  42. </div>
  43. <div>
  44. Checks if the loaded object needs tangents based on its materials.
  45. </div>
  46. <h3>[method:null updateProgress]( [page:object progress] )</h3>
  47. <div>
  48. [page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
  49. </div>
  50. <div>
  51. Updates the DOM object with the progress made.
  52. </div>
  53. <h3>[method:Material createMaterial]( [page:object m], [page:string texturePath] )</h3>
  54. <div>
  55. [page:Object m] — The parameters to create the material. <br />
  56. [page:String texturePath] — The base path of the textures.
  57. </div>
  58. <div>
  59. Creates the Material based on the parameters m.
  60. </div>
  61. <h3>[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )</h3>
  62. <div>
  63. [page:Array materials] — an array of parameters to create materials. <br />
  64. [page:String texturePath] — The base path of the textures.
  65. </div>
  66. <div>
  67. 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.
  68. </div>
  69. <h3>[method:String extractUrlBase]( [page:string url] )</h3>
  70. <div>
  71. [page:String url] — The url to extract the base url from.
  72. </div>
  73. <div>
  74. Extract the base from the URL.
  75. </div>
  76. <h3>[method:DOMElement addStatusElement]()</h3>
  77. <div>
  78. Add a DOM element to indicate the progress and return the DOMElement
  79. </div>
  80. <h2>Source</h2>
  81. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  82. </body>
  83. </html>