Clock.d.ts 1.4 KB

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