@animech-public/playcanvas
Version:
PlayCanvas WebGL game engine
63 lines (62 loc) • 2.31 kB
TypeScript
/**
* Implementation of the GLTF 2.0 format exporter.
*
* @category Exporter
*/
export class GltfExporter extends CoreExporter {
static writeBufferView(resources: any, json: any, buffer: any): void;
static createPrimitive(resources: any, json: any, mesh: any): {
attributes: {};
};
/**
* @ignore
*/
collectResources(root: any): {
buffers: any[];
cameras: any[];
entities: any[];
materials: any[];
textures: any[];
entityMeshInstances: any[];
bufferViewMap: Map<any, any>;
compressableTexture: Set<any>;
};
writeBufferViews(resources: any, json: any): void;
writeCameras(resources: any, json: any): void;
attachTexture(resources: any, material: any, destination: any, name: any, textureSemantic: any, json: any): void;
writeStandardMaterial(resources: any, mat: any, output: any, json: any): void;
writeBasicMaterial(resources: any, mat: any, output: any, json: any): void;
writeMaterials(resources: any, json: any): void;
writeNodes(resources: any, json: any): void;
writeMeshes(resources: any, json: any): void;
convertTextures(srcTextures: any, options: any): any[];
writeTextures(resources: any, textureCanvases: any, json: any, options: any): Promise<any[]>;
getBlob(canvas: any, mimeType: any): any;
getPaddedArrayBuffer(arrayBuffer: any, paddingByte?: number): any;
buildJson(resources: any, options: any): Promise<{
asset: {
version: string;
generator: string;
};
scenes: {
nodes: number[];
}[];
images: any[];
samplers: any[];
textures: any[];
scene: number;
}>;
/**
* Converts a hierarchy of entities to GLB format.
*
* @param {import('playcanvas').Entity} entity - The root of the entity hierarchy to convert.
* @param {object} options - Object for passing optional arguments.
* @param {number} [options.maxTextureSize] - Maximum texture size. Texture is resized if over
* the size.
* @returns {Promise<ArrayBuffer>} - The GLB file content.
*/
build(entity: any, options?: {
maxTextureSize?: number;
}): Promise<ArrayBuffer>;
}
import { CoreExporter } from './core-exporter.js';