@tolokoban/tgd
Version:
ToloGameDev library for WebGL2
52 lines • 2.84 kB
TypeScript
/**
* GLTF specs can be found here:
* https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html
*/
import { TgdDataset } from "../../dataset";
import { TgdFormatGltf, TgdFormatGltfAccessor, TgdFormatGltfMaterial, TgdFormatGltfMesh, TgdFormatGltfMeshPrimitive, TgdFormatGltfNode, TgdFormatGltfScene } from "../../types/gltf";
import { TgdTypeArrayForElements } from "../../types";
import { TgdGeometry } from "../../geometry";
import { TgdTexture2D } from "../../texture";
export declare class TgdParserGLTransfertFormatBinary {
readonly gltf: Readonly<TgdFormatGltf>;
private readonly chunks;
private readonly cacheImages;
private readonly cacheImageURLs;
private readonly cacheBufferViewDatas;
constructor(content: ArrayBuffer);
get fileSize(): number;
getScenes(): TgdFormatGltfScene[];
getScene(sceneIndex: number): TgdFormatGltfScene;
getNode(nodeIndex: number): TgdFormatGltfNode;
getNodeByName(nodeName: string): TgdFormatGltfNode | undefined;
getNodeByNameOrThrow(nodeName: string): TgdFormatGltfNode;
getAccessor(accessorIndex?: number): TgdFormatGltfAccessor;
getMaterial(materialIndex: number): TgdFormatGltfMaterial;
getMesh(meshIndex?: number): TgdFormatGltfMesh;
getMeshPrimitive(meshIndex?: number, primitiveIndex?: number): {
attributes: Record<string, number>;
indices?: number;
mode?: number;
material?: number;
};
getMeshPrimitiveIndices(meshIndex?: number, primitiveIndex?: number): TgdTypeArrayForElements;
getAccessorByAttributeName(primitive: TgdFormatGltfMeshPrimitive, attribName: string): TgdFormatGltfAccessor;
createTexture2D(context: {
gl: WebGL2RenderingContext;
}, textureIndex: number): TgdTexture2D;
loadImage(imageIndex: number): Promise<HTMLImageElement | undefined>;
getImageURL(imageIndex: number): string | undefined;
getBufferViewData(accessor: TgdFormatGltfAccessor): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
getBufferViewData(bufferViewIndex: number, type?: number | "Int8" | "Uint8" | "Int16" | "Uint16" | "Uint32" | "Float32"): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
findAccessorForBufferView(bufferViewIndex: number): TgdFormatGltfAccessor | undefined;
setAttrib(dataset: TgdDataset, attribName: string, meshIndex?: number, primitiveIndex?: number, primitiveAttribName?: string): void;
makeGeometry({ computeNormals, meshIndex, primitiveIndex, attPositionName, attNormalName, attTextureCoordsName, }?: {
computeNormals?: boolean;
meshIndex?: number;
primitiveIndex?: number;
attPositionName?: string;
attNormalName?: string;
attTextureCoordsName?: string;
}): TgdGeometry;
}
//# sourceMappingURL=gltf.d.ts.map