nanogl-gltf
Version:
24 lines (23 loc) • 836 B
JavaScript
import GltfTypes from '../types/GltfTypes';
const GL_REPEAT = 10497;
/**
* The Sampler element contains the texture filtering and wrapping properties, determining how a texture should be sampled.
*/
export default class Sampler {
constructor() {
this.gltftype = GltfTypes.SAMPLER;
}
/**
* Parse the Sampler data, fill the magFilter, minFilter, wrapS and wrapT properties.
* @param gltfLoader GLTFLoader to use, unused here
* @param data Data to parse
*/
parse(gltfLoader, data) {
var _a, _b;
this.magFilter = data.magFilter;
this.minFilter = data.minFilter;
this.wrapS = (_a = data.wrapS) !== null && _a !== void 0 ? _a : GL_REPEAT;
this.wrapT = (_b = data.wrapT) !== null && _b !== void 0 ? _b : GL_REPEAT;
return Promise.resolve();
}
}