Files
old-allhands-vr/node_modules/three/examples/js/nodes/inputs/IntNode.js

30 lines
498 B
JavaScript
Raw Normal View History

2017-11-19 15:16:07 +01:00
/**
* @author sunag / http://www.sunag.com.br/
*/
THREE.IntNode = function( value ) {
THREE.InputNode.call( this, 'iv1' );
this.value = [ Math.floor( value || 0 ) ];
};
THREE.IntNode.prototype = Object.create( THREE.InputNode.prototype );
THREE.IntNode.prototype.constructor = THREE.IntNode;
Object.defineProperties( THREE.IntNode.prototype, {
number: {
get: function() {
return this.value[ 0 ];
},
set: function( val ) {
this.value[ 0 ] = Math.floor( val );
}
}
} );