| Server IP : 137.184.226.51 / Your IP : 10.8.0.1 Web Server : Apache/2.4.41 (Ubuntu) System : Linux vm8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : ( 1000) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/aspa/three/core/ |
Upload File : |
import * as MathUtils from '../math/MathUtils.js';
import { StaticDrawUsage } from '../constants.js';
import { warnOnce } from '../utils.js';
class InterleavedBuffer {
constructor( array, stride ) {
this.isInterleavedBuffer = true;
this.array = array;
this.stride = stride;
this.count = array !== undefined ? array.length / stride : 0;
this.usage = StaticDrawUsage;
this._updateRange = { offset: 0, count: - 1 };
this.updateRanges = [];
this.version = 0;
this.uuid = MathUtils.generateUUID();
}
onUploadCallback() {}
set needsUpdate( value ) {
if ( value === true ) this.version ++;
}
get updateRange() {
warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
return this._updateRange;
}
setUsage( value ) {
this.usage = value;
return this;
}
addUpdateRange( start, count ) {
this.updateRanges.push( { start, count } );
}
clearUpdateRanges() {
this.updateRanges.length = 0;
}
copy( source ) {
this.array = new source.array.constructor( source.array );
this.count = source.count;
this.stride = source.stride;
this.usage = source.usage;
return this;
}
copyAt( index1, attribute, index2 ) {
index1 *= this.stride;
index2 *= attribute.stride;
for ( let i = 0, l = this.stride; i < l; i ++ ) {
this.array[ index1 + i ] = attribute.array[ index2 + i ];
}
return this;
}
set( value, offset = 0 ) {
this.array.set( value, offset );
return this;
}
clone( data ) {
if ( data.arrayBuffers === undefined ) {
data.arrayBuffers = {};
}
if ( this.array.buffer._uuid === undefined ) {
this.array.buffer._uuid = MathUtils.generateUUID();
}
if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
data.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;
}
const array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );
const ib = new this.constructor( array, this.stride );
ib.setUsage( this.usage );
return ib;
}
onUpload( callback ) {
this.onUploadCallback = callback;
return this;
}
toJSON( data ) {
if ( data.arrayBuffers === undefined ) {
data.arrayBuffers = {};
}
// generate UUID for array buffer if necessary
if ( this.array.buffer._uuid === undefined ) {
this.array.buffer._uuid = MathUtils.generateUUID();
}
if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
data.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );
}
//
return {
uuid: this.uuid,
buffer: this.array.buffer._uuid,
type: this.array.constructor.name,
stride: this.stride
};
}
}
export { InterleavedBuffer };