Clock.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Object for keeping track of time.
  3. *
  4. * @see <a href="https://github.com/mrdoob/three.js/blob/master/src/core/Clock.js">src/core/Clock.js</a>
  5. */
  6. export class Clock {
  7. /**
  8. * @param autoStart Automatically start the clock.
  9. */
  10. constructor( autoStart?: boolean );
  11. /**
  12. * If set, starts the clock automatically when the first update is called.
  13. */
  14. autoStart: boolean;
  15. /**
  16. * When the clock is running, It holds the starttime of the clock.
  17. * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
  18. */
  19. startTime: number;
  20. /**
  21. * When the clock is running, It holds the previous time from a update.
  22. * This counted from the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
  23. */
  24. oldTime: number;
  25. /**
  26. * When the clock is running, It holds the time elapsed between the start of the clock to the previous update.
  27. * This parameter is in seconds of three decimal places.
  28. */
  29. elapsedTime: number;
  30. /**
  31. * This property keeps track whether the clock is running or not.
  32. */
  33. running: boolean;
  34. /**
  35. * Starts clock.
  36. */
  37. start(): void;
  38. /**
  39. * Stops clock.
  40. */
  41. stop(): void;
  42. /**
  43. * Get the seconds passed since the clock started.
  44. */
  45. getElapsedTime(): number;
  46. /**
  47. * Get the seconds passed since the last call to this method.
  48. */
  49. getDelta(): number;
  50. }