Files
apt-nl-map/static/Magic4/js/three.js-dev/examples/jsm/nodes/inputs/IntNode.js

52 lines
688 B
JavaScript
Raw Normal View History

2024-12-04 10:21:04 +08:00
import { InputNode } from '../core/InputNode.js';
class IntNode extends InputNode {
constructor( value ) {
super( 'i' );
this.value = Math.floor( value || 0 );
}
generateReadonly( builder, output, uuid, type/*, ns, needsUpdate */ ) {
return builder.format( this.value, type, output );
}
copy( source ) {
super.copy( source );
this.value = source.value;
return this;
}
toJSON( meta ) {
let data = this.getJSONNode( meta );
if ( ! data ) {
data = this.createJSONNode( meta );
data.value = this.value;
if ( this.readonly === true ) data.readonly = true;
}
return data;
}
}
IntNode.prototype.nodeType = 'Int';
export { IntNode };