修复纹理调节项不生效的问题

This commit is contained in:
2026-04-28 13:41:17 +08:00
parent 9045cb79c2
commit 7e4b09133d
4 changed files with 15 additions and 8 deletions

View File

@@ -85,15 +85,15 @@ const sceneSetup = () => {
/** 这是自定义材质更新方法WebCAD库中的TextureTableRecord.TextureUpdate方法在导出的时候被删除了所以需要自己实现 */
function UpdateTexture() {
function UpdateTexture(adjustment?: Partial<TextureAdjustment>) {
const record = _currTexture.value;
const texture = record['texture'] as Texture;
texture.wrapS = record.WrapS;
texture.wrapT = record.WrapT;
texture.wrapS = adjustment?.wrapS ?? record.WrapS;
texture.wrapT = adjustment?.wrapT ?? record.WrapT;
texture.anisotropy = 16;
texture.rotation = record.rotation;
texture.repeat.set(record.repeatX, record.repeatY);
texture.offset.set(record.moveX, record.moveY);
texture.rotation = adjustment?.rotation ?? record.rotation;
texture.repeat.set(adjustment?.repeatX ?? record.repeatX, adjustment?.repeatY ?? record.repeatY);
texture.offset.set(adjustment?.moveX ?? record.moveX, adjustment?.moveY ?? record.moveY);
texture.needsUpdate = true;
Update();
}