Clock.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Clock - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <h1 translate="no">Clock</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Class for keeping track of time.</p></div>
  16. </header>
  17. <article>
  18. <div class="container-overview">
  19. <h2>Constructor</h2>
  20. <h3 class="name name-method" id="Clock" translate="no">new <a href="#Clock">Clock</a><span class="signature">( autoStart : <span class="param-type">boolean</span> )</span> </h3>
  21. <div class="method">
  22. <div class="description">
  23. <p>Constructs a new clock.</p>
  24. </div>
  25. <table class="params">
  26. <tbody>
  27. <tr>
  28. <td class="name">
  29. <strong translate="no">autoStart</strong>
  30. </td>
  31. <td class="description last">
  32. <p>Whether to automatically start the clock when
  33. <code>getDelta()</code> is called for the first time.</p>
  34. <p>Default is <code>true</code>.</p>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. <dl class="details">
  40. <dt class="important tag-deprecated"><strong>Deprecated:</strong> since r183.</dt>
  41. </dl>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Properties</h2>
  45. <div class="member">
  46. <h3 class="name" id="autoStart" translate="no">.<a href="#autoStart">autoStart</a><span class="type-signature"> : boolean</span> </h3>
  47. <div class="description">
  48. <p>If set to <code>true</code>, the clock starts automatically when <code>getDelta()</code> is called
  49. for the first time.</p>
  50. <p>Default is <code>true</code>.</p>
  51. </div>
  52. </div>
  53. <div class="member">
  54. <h3 class="name" id="elapsedTime" translate="no">.<a href="#elapsedTime">elapsedTime</a><span class="type-signature"> : number</span> </h3>
  55. <div class="description">
  56. <p>Keeps track of the total time that the clock has been running.</p>
  57. <p>Default is <code>0</code>.</p>
  58. </div>
  59. </div>
  60. <div class="member">
  61. <h3 class="name" id="oldTime" translate="no">.<a href="#oldTime">oldTime</a><span class="type-signature"> : number</span> </h3>
  62. <div class="description">
  63. <p>Holds the time at which the clock's <code>start()</code>, <code>getElapsedTime()</code> or
  64. <code>getDelta()</code> methods were last called.</p>
  65. <p>Default is <code>0</code>.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="running" translate="no">.<a href="#running">running</a><span class="type-signature"> : boolean</span> </h3>
  70. <div class="description">
  71. <p>Whether the clock is running or not.</p>
  72. <p>Default is <code>true</code>.</p>
  73. </div>
  74. </div>
  75. <div class="member">
  76. <h3 class="name" id="startTime" translate="no">.<a href="#startTime">startTime</a><span class="type-signature"> : number</span> </h3>
  77. <div class="description">
  78. <p>Holds the time at which the clock's <code>start()</code> method was last called.</p>
  79. <p>Default is <code>0</code>.</p>
  80. </div>
  81. </div>
  82. <h2 class="subsection-title">Methods</h2>
  83. <h3 class="name name-method" id="getDelta" translate="no">.<a href="#getDelta">getDelta</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  84. <div class="method">
  85. <div class="description">
  86. <p>Returns the delta time in seconds.</p>
  87. </div>
  88. <dl class="details">
  89. <dt class="tag-returns"><strong>Returns:</strong> The delta time.</dt>
  90. </dl>
  91. </div>
  92. <h3 class="name name-method" id="getElapsedTime" translate="no">.<a href="#getElapsedTime">getElapsedTime</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  93. <div class="method">
  94. <div class="description">
  95. <p>Returns the elapsed time in seconds.</p>
  96. </div>
  97. <dl class="details">
  98. <dt class="tag-returns"><strong>Returns:</strong> The elapsed time.</dt>
  99. </dl>
  100. </div>
  101. <h3 class="name name-method" id="start" translate="no">.<a href="#start">start</a><span class="signature">()</span> </h3>
  102. <div class="method">
  103. <div class="description">
  104. <p>Starts the clock. When <code>autoStart</code> is set to <code>true</code>, the method is automatically
  105. called by the class.</p>
  106. </div>
  107. </div>
  108. <h3 class="name name-method" id="stop" translate="no">.<a href="#stop">stop</a><span class="signature">()</span> </h3>
  109. <div class="method">
  110. <div class="description">
  111. <p>Stops the clock.</p>
  112. </div>
  113. </div>
  114. <h2 class="subsection-title">Source</h2>
  115. <p>
  116. <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js" translate="no" target="_blank" rel="noopener">src/core/Clock.js</a>
  117. </p>
  118. </article>
  119. </section>
  120. <script src="../scripts/linenumber.js"></script>
  121. <script src="../scripts/page.js"></script>
  122. </body>
  123. </html>
粤ICP备19079148号