Spinner.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. "atomic component";
  2. "use strict";
  3. var __extends = (this && this.__extends) || function (d, b) {
  4. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5. function __() { this.constructor = d; }
  6. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7. };
  8. /**
  9. * Component that will rotate a node at a configurable speed.
  10. */
  11. var Spinner = (function (_super) {
  12. __extends(Spinner, _super);
  13. function Spinner() {
  14. var _this = _super.apply(this, arguments) || this;
  15. /**
  16. * Fields witihin the inspectorFields object will be exposed to the editor
  17. */
  18. _this.inspectorFields = {
  19. speed: 1.0
  20. };
  21. return _this;
  22. }
  23. /**
  24. * Update called every cycle with timeStep containing the delta between calls
  25. * @param {number} timeStep time since last call to update
  26. */
  27. Spinner.prototype.update = function (timeStep) {
  28. this.node.yaw(timeStep * 75 * this.speed);
  29. };
  30. return Spinner;
  31. }(Atomic.JSComponent));
  32. Object.defineProperty(exports, "__esModule", { value: true });
  33. exports.default = Spinner;