threepipe
Version:
A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
67 lines • 2.72 kB
TypeScript
import { Loader, Vector2 } from 'three';
/**
* Loads a Wavefront .mtl file specifying materials
*/
declare class MTLLoader2 extends Loader {
constructor(manager: any);
/**
* Loads and parses a MTL asset from a URL.
*
* @param {String} url - URL to the MTL file.
* @param {Function} [onLoad] - Callback invoked with the loaded object.
* @param {Function} [onProgress] - Callback for download progress.
* @param {Function} [onError] - Callback for download errors.
*
* @link setPath setResourcePath
*
* @note In order for relative texture references to resolve correctly
* you must call setResourcePath() explicitly prior to load.
*/
load(url: any, onLoad: any, onProgress: any, onError: any): void;
setMaterialOptions(value: any): this;
/**
* Parses a MTL file.
*
* @param {String} text - Content of MTL file
* @return {MaterialCreator}
*
* @link setPath setResourcePath
*
* @note In order for relative texture references to resolve correctly
* you must call setResourcePath() explicitly prior to parse.
*/
parse(text: any, path: any): MaterialCreator;
}
/**
* Create a new MTLLoader2.MaterialCreator
* @param baseUrl - Url relative to which textures are loaded
* @param options - Set of options on how to construct the materials
* side: Which side to apply the material
* FrontSide (default), THREE.BackSide, THREE.DoubleSide
* wrap: What type of wrapping to apply for textures
* RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping
* normalizeRGB: RGBs need to be normalized to 0-1 from 0-255
* Default: false, assumed to be already normalized
* ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's
* Default: false
* @constructor
*/
declare class MaterialCreator {
constructor(baseUrl?: string, options?: {});
setCrossOrigin(value: any): this;
setManager(value: any): void;
setMaterials(materialsInfo: any): void;
convert(materialsInfo: any): any;
preload(): Promise<void>;
getIndex(materialName: any): any;
getAsArray(): Promise<any>;
create(materialName: any): Promise<any>;
createMaterial_(materialName: any): Promise<any>;
getTextureParams(value: any, matParams: any): {
scale: Vector2;
offset: Vector2;
};
loadTexture(url: any, mapping: any, onLoad: any, onProgress: any, onError: any): any;
}
export { MTLLoader2, type MaterialCreator };
//# sourceMappingURL=MTLLoader2.d.ts.map