Clock.html 4.9 KB

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