import { Buffer, BufferOptions } from '../resources'; /** * @public */ export interface ModelBuilderChannelMap { [key: string]: ModelBuilderChannel; } /** * @public */ export declare class ModelBuilderChannel { /** * The vertex stride of the current buffer * * @remarks * For example if a vertex has a `position` and a `normal` * (both with three elements) it has a stride of 6 elements. */ readonly stride: number; /** * Offset to the first attribute element from beginning of vertex * * @remarks * For example if a vertex consists of a `position` followed by a `normal` * (both with three elements) * the `position` has an offset of 0 and the `normal` an offset of 3 */ readonly offset: number; /** * Number of elements in a single attribute. e.g. a Vec3 has 3 elements */ readonly elements: number; /** * The semantic name of this channel */ readonly name: string; readonly buffer: BufferOptions; /** * Returns the number of attributes */ get count(): number; private data; constructor(buffer: BufferOptions, name: string); /** * Reads a single element value of a vertex attribute. * * @param vIndex - The vertex index to read at * @param elementIndex - The element index to read. e.g. `0` is usually the `x` coordinate, `1` is `y` etc. */ read(vIndex: number, elementIndex: number): number; /** * Reads a whole vertex attribute into the given target array * * @param vIndex - The vertex index to read at * @param target - The target array to read into * @param targetOffset - The offset in target array where to start writing */ readAttribute(vIndex: number, target?: number[], targetOffset?: number): number[]; /** * Writes a single element value to a vertex attribute * * @param vIndex - The vertex index to write to * @param elementIndex - The element index to write. e.g. `0` is usually the `x` coordinate, `1` is `y` etc. * @param value - The value */ write(vIndex: number, elementIndex: number, value: number): void; /** * Writes a whole vertex attribute at given vertex index * * @param vIndex - The vertex index to write at * @param source - The attribute data to write * @param sourceOffset - The offset in source array where to start reading */ writeAttribute(vIndex: number, source: ReadonlyArray, sourceOffset?: number): void; /** * Reads a vertex attribute channel from start to end and emits each attribute * * @param emitter - The callback function * @param startVertex - The start vertex index where the scan begins * @param endVertex - The end vertex index where the scan ends */ forEach(emitter: (attr: number[], index: number) => void, startVertex?: number, endVertex?: number): void; static fromVertexBuffer(vBuffers: Array): ModelBuilderChannelMap; } //# sourceMappingURL=ModelBuilderChannel.d.ts.map