2
0

NodeFrame.js 505 B

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