import GLTF from "./Schema/GLTF"; import GLTFImage from "./Schema/GLTFImage"; import GLTFBuffer from "./Schema/GLTFBuffer"; import GLTFMaterial from "./Schema/GLTFMaterial"; import GLTFAnimation from "./Schema/GLTFAnimation"; import ParserModuleBase from "./ParserModuleBase"; import Texture2D from "grimoirejs-fundamental/ref/Resource/Texture2D"; import Geometry from "grimoirejs-fundamental/ref/Geometry/Geometry"; import Material from "grimoirejs-fundamental/ref/Material/Material"; import Parser from "./Parser"; import IAnimationRecipe from "grimoirejs-animation/ref/Animation/Schema/IAnimationRecipe"; import { ConvertToTextureArgument, LoadBufferViewsArgument, LoadPrimitivesOfMeshArgument, LoadPrimitiveArgument, AppendIndicesArgument, AddVertexAttributesArgument } from "./Arguments"; export default class ParserModule extends ParserModuleBase { parser: Parser; baseDirectory: string; protected __gl: WebGLRenderingContext; constructor(parser: Parser, baseDirectory: string); fetchGLTF(url: string): Promise; /** * Load .gltf file * @return {Promise} [description] */ loadAsGLTF(tf: ArrayBuffer): GLTF; /** * Start loading texture resource. * @return {Promise} [description] */ fetchTextureResource(tf: GLTFImage): Promise; /** * Start loading texture resource. * @return {Promise} [description] */ loadTextureResources(tf: GLTF): Promise<{ [key: string]: Texture2D; }>; /** * Load image as texture * @return {Promise} [description] */ convertTotexture(arg: ConvertToTextureArgument): Texture2D; /** * Start loading buffer resource. * @return {Promise} [description] */ loadBufferResource(tf: GLTFBuffer): Promise; loadBufferResources(tf: GLTF): Promise<{ [key: string]: ArrayBuffer; }>; loadBufferViews(args: LoadBufferViewsArgument): { [key: string]: ArrayBufferView; }; loadPrimitivesOfMesh(args: LoadPrimitivesOfMeshArgument): { [key: string]: Geometry[]; }; loadPrimitive(args: LoadPrimitiveArgument): Geometry; appendIndices(args: AppendIndicesArgument): boolean; addVertexAttributes(args: AddVertexAttributesArgument): boolean; complementVertexAttributes(args: AddVertexAttributesArgument): boolean; loadMaterials(args: { tf: GLTF; textures: { [key: string]: Texture2D; }; }): Promise<{ [key: string]: Material; }>; loadMaterial(args: { material: GLTFMaterial; textures: { [key: string]: Texture2D; }; }): Promise; loadAnimations(args: { tf: GLTF; bufferViews: { [key: string]: ArrayBufferView; }; }): { [key: string]: IAnimationRecipe; }; loadAnimation(args: { tf: GLTF; bufferViews: { [key: string]: ArrayBufferView; }; animation: GLTFAnimation; }): IAnimationRecipe; }