NodeFrame.js 487 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.NodeFrame = function ( time ) {
  5. this.time = time !== undefined ? time : 0;
  6. this.frameId = 0;
  7. };
  8. THREE.NodeFrame.prototype.update = function ( delta ) {
  9. ++this.frameId;
  10. this.time += delta;
  11. this.delta = delta;
  12. return this;
  13. };
  14. THREE.NodeFrame.prototype.updateNode = function ( node ) {
  15. if ( node.frameId === this.frameId ) return this;
  16. node.updateFrame( this );
  17. node.frameId = this.frameId;
  18. return this;
  19. };