IntNode.js 498 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.IntNode = function( value ) {
  5. THREE.InputNode.call( this, 'iv1' );
  6. this.value = [ Math.floor( value || 0 ) ];
  7. };
  8. THREE.IntNode.prototype = Object.create( THREE.InputNode.prototype );
  9. THREE.IntNode.prototype.constructor = THREE.IntNode;
  10. Object.defineProperties( THREE.IntNode.prototype, {
  11. number: {
  12. get: function() {
  13. return this.value[ 0 ];
  14. },
  15. set: function( val ) {
  16. this.value[ 0 ] = Math.floor( val );
  17. }
  18. }
  19. } );