ProtoSpinner.js 433 B

12345678910111213141516171819202122232425
  1. // JavaScript prototype inheritance Component
  2. 'atomic component';
  3. var inspectorFields = {
  4. speed: 1.0
  5. };
  6. function ProtoSpinner() {
  7. Atomic.JSComponent.call(this);
  8. }
  9. ProtoSpinner.prototype = Object.create(Atomic.JSComponent.prototype);
  10. ProtoSpinner.prototype.constructor = ProtoSpinner;
  11. ProtoSpinner.prototype.update = function(timeStep) {
  12. this.node.yaw(timeStep * 75 * this.speed);
  13. };
  14. module.exports = ProtoSpinner;