node-ejs-renderer/node_modules/three/examples/jsm/renderers/common/Buffer.js

39 lines
472 B
JavaScript
Raw Normal View History

2024-06-09 13:55:01 -04:00
import Binding from './Binding.js';
import { getFloatLength } from './BufferUtils.js';
class Buffer extends Binding {
constructor( name, buffer = null ) {
super( name );
this.isBuffer = true;
this.bytesPerElement = Float32Array.BYTES_PER_ELEMENT;
this._buffer = buffer;
}
get byteLength() {
return getFloatLength( this._buffer.byteLength );
}
get buffer() {
return this._buffer;
}
update() {
return true;
}
}
export default Buffer;