Clock.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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"><code>autoStart</code></td>
  29. <td class="description last"><p>Whether to automatically start the clock when
  30. <code>getDelta()</code> is called for the first time.<br/>Default is <code>true</code>.</p></td>
  31. </tr>
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. <h2 class="subsection-title">Properties</h2>
  37. <div class="member">
  38. <h3 class="name" id="autoStart" translate="no">.<a href="#autoStart">autoStart</a><span class="type-signature"> : boolean</span> </h3>
  39. <div class="description">
  40. <p>If set to <code>true</code>, the clock starts automatically when <code>getDelta()</code> is called
  41. for the first time.<br/>Default is <code>true</code>.</p>
  42. </div>
  43. </div>
  44. <div class="member">
  45. <h3 class="name" id="elapsedTime" translate="no">.<a href="#elapsedTime">elapsedTime</a><span class="type-signature"> : number</span> </h3>
  46. <div class="description">
  47. <p>Keeps track of the total time that the clock has been running.<br/>Default is <code>0</code>.</p>
  48. </div>
  49. </div>
  50. <div class="member">
  51. <h3 class="name" id="oldTime" translate="no">.<a href="#oldTime">oldTime</a><span class="type-signature"> : number</span> </h3>
  52. <div class="description">
  53. <p>Holds the time at which the clock's <code>start()</code>, <code>getElapsedTime()</code> or
  54. <code>getDelta()</code> methods were last called.<br/>Default is <code>0</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="running" translate="no">.<a href="#running">running</a><span class="type-signature"> : boolean</span> </h3>
  59. <div class="description">
  60. <p>Whether the clock is running or not.<br/>Default is <code>true</code>.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="startTime" translate="no">.<a href="#startTime">startTime</a><span class="type-signature"> : number</span> </h3>
  65. <div class="description">
  66. <p>Holds the time at which the clock's <code>start()</code> method was last called.<br/>Default is <code>0</code>.</p>
  67. </div>
  68. </div>
  69. <h2 class="subsection-title">Methods</h2>
  70. <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>
  71. <div class="method">
  72. <div class="description">
  73. <p>Returns the delta time in seconds.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> The delta time.</dt>
  77. </dl>
  78. </div>
  79. <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>
  80. <div class="method">
  81. <div class="description">
  82. <p>Returns the elapsed time in seconds.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-returns"><strong>Returns:</strong> The elapsed time.</dt>
  86. </dl>
  87. </div>
  88. <h3 class="name name-method" id="start" translate="no">.<a href="#start">start</a><span class="signature">()</span> </h3>
  89. <div class="method">
  90. <div class="description">
  91. <p>Starts the clock. When <code>autoStart</code> is set to <code>true</code>, the method is automatically
  92. called by the class.</p>
  93. </div>
  94. </div>
  95. <h3 class="name name-method" id="stop" translate="no">.<a href="#stop">stop</a><span class="signature">()</span> </h3>
  96. <div class="method">
  97. <div class="description">
  98. <p>Stops the clock.</p>
  99. </div>
  100. </div>
  101. <h2 class="subsection-title">Source</h2>
  102. <p>
  103. <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js" target="_blank" rel="noopener" translate="no">src/core/Clock.js</a>
  104. </p>
  105. </article>
  106. </section>
  107. <script src="../scripts/linenumber.js"></script>
  108. <script src="../scripts/page.js"></script>
  109. </body>
  110. </html>
粤ICP备19079148号