Buckets:
| import { InterleavedBuffer } from './InterleavedBuffer.js'; | |
| /** | |
| * An instanced version of an interleaved buffer. | |
| * | |
| * @augments InterleavedBuffer | |
| */ | |
| class InstancedInterleavedBuffer extends InterleavedBuffer { | |
| /** | |
| * Constructs a new instanced interleaved buffer. | |
| * | |
| * @param {TypedArray} array - A typed array with a shared buffer storing attribute data. | |
| * @param {number} stride - The number of typed-array elements per vertex. | |
| * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated. | |
| */ | |
| constructor( array, stride, meshPerAttribute = 1 ) { | |
| super( array, stride ); | |
| /** | |
| * This flag can be used for type testing. | |
| * | |
| * @type {boolean} | |
| * @readonly | |
| * @default true | |
| */ | |
| this.isInstancedInterleavedBuffer = true; | |
| /** | |
| * Defines how often a value of this buffer attribute should be repeated, | |
| * see {@link InstancedBufferAttribute#meshPerAttribute}. | |
| * | |
| * @type {number} | |
| * @default 1 | |
| */ | |
| this.meshPerAttribute = meshPerAttribute; | |
| } | |
| copy( source ) { | |
| super.copy( source ); | |
| this.meshPerAttribute = source.meshPerAttribute; | |
| return this; | |
| } | |
| clone( data ) { | |
| const ib = super.clone( data ); | |
| ib.meshPerAttribute = this.meshPerAttribute; | |
| return ib; | |
| } | |
| toJSON( data ) { | |
| const json = super.toJSON( data ); | |
| json.isInstancedInterleavedBuffer = true; | |
| json.meshPerAttribute = this.meshPerAttribute; | |
| return json; | |
| } | |
| } | |
| export { InstancedInterleavedBuffer }; | |
Xet Storage Details
- Size:
- 1.49 kB
- Xet hash:
- 3bfac96272a13ab44b0f467a164b8e3ed2286751286702419ed4329400688f8d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.