NodeInt.js 495 B

123456789101112131415161718192021
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. THREE.NodeInt = function( value ) {
  5. THREE.NodeInput.call( this, 'fv1', {share:false} );
  6. this.value = [ Math.floor(value || 0) ];
  7. };
  8. THREE.NodeInt.prototype = Object.create( THREE.NodeInput.prototype );
  9. THREE.NodeInt.prototype.constructor = THREE.NodeInt;
  10. Object.defineProperties( THREE.NodeInt.prototype, {
  11. number: {
  12. get: function () { return this.value[0]; },
  13. set: function ( val ) { this.value[0] = Math.floor(val); }
  14. }
  15. });