Spinner.js 424 B

123456789101112131415161718
  1. "atomic component";
  2. //define inspector fields
  3. var inspectorFields = {
  4. //value speed will be able to be edited from editor
  5. //default value sets to the 1.0, so speed has a number type
  6. speed: 1.0
  7. };
  8. exports.component = function(self) {
  9. //update function calls each frame
  10. self.update = function(timeStep) {
  11. //rotate node around Y axis
  12. self.node.yaw(timeStep * 75 * self.speed);
  13. };
  14. };