@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
38 lines (35 loc) • 930 B
JavaScript
import { c as cloneTexture2D } from './texture-2d-CMQ0_OPI.esm.js';
const ext = {
id: "KHR_texture_transform",
wrapTexture(tex, texInfo) {
const info = texInfo;
if (!info) {
return tex;
}
const kt = info.extensions?.KHR_texture_transform;
const patch = {};
if (kt) {
if (kt.scale) {
patch.uScale = kt.scale[0];
patch.vScale = kt.scale[1];
}
if (kt.offset) {
patch.uOffset = kt.offset[0];
patch.vOffset = kt.offset[1];
}
if (kt.rotation) {
patch.uAng = kt.rotation;
}
if (Object.keys(patch).length) {
patch._hasTx = true;
}
}
const tc = kt?.texCoord ?? info.texCoord;
if (tc === 1) {
patch._texCoord = 1;
}
return Object.keys(patch).length ? cloneTexture2D(tex, patch) : tex;
}
};
export { ext as default };
//# sourceMappingURL=gltf-ext-uv-transform-BuxByHwO.esm.js.map