import { AssetPromise, IndexFormat, Texture2D, TypedArray, VertexElementFormat } from "@galacean/engine-core"; import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math"; import { AccessorComponentType, AccessorType, IAccessor, IBufferView, IGLTF, ISampler, ISamplerInfo } from "./GLTFSchema"; import { BufferInfo, GLTFParserContext } from "./parser/GLTFParserContext"; /** * @internal */ export declare class GLTFUtils { static floatBufferToVector2Array(buffer: Float32Array): Vector2[]; static floatBufferToVector3Array(buffer: Float32Array): Vector3[]; static floatBufferToVector4Array(buffer: Float32Array): Vector4[]; static floatBufferToColorArray(buffer: Float32Array, isColor3: boolean): Color[]; /** * Get the number of bytes occupied by accessor type. */ static getAccessorTypeSize(accessorType: AccessorType): number; /** * Get the TypedArray corresponding to the component type. */ static getComponentType(componentType: AccessorComponentType): Float32ArrayConstructor | Uint32ArrayConstructor | Uint8ArrayConstructor | Uint16ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor; static getNormalizedComponentScale(componentType: AccessorComponentType): number; static getAccessorBuffer(context: GLTFParserContext, bufferViews: IBufferView[], accessor: IAccessor): AssetPromise; static bufferToVector3Array(buffer: TypedArray, byteOffset: number, count: number, normalized: boolean, componentType: AccessorComponentType): Vector3[]; static getBufferViewData(bufferView: IBufferView, buffers: ArrayBuffer[]): ArrayBuffer; /** * Get accessor data. */ static processingSparseData(context: GLTFParserContext, accessor: IAccessor, bufferInfo: BufferInfo): AssetPromise; static getIndexFormat(type: AccessorComponentType): IndexFormat; static getElementFormat(type: AccessorComponentType, size: number, normalized?: boolean): VertexElementFormat; /** * Load image buffer */ static loadImageBuffer(imageBuffer: TypedArray, type: string): Promise; /** * Parse the glb format. */ static parseGLB(context: GLTFParserContext, originBuffer: ArrayBuffer): { glTF?: IGLTF; buffers?: ArrayBuffer[]; originBuffer?: ArrayBuffer; }; static parseSampler(texture: Texture2D, samplerInfo: ISamplerInfo): void; static getSamplerInfo(sampler: ISampler): ISamplerInfo; }