修复纹理调节项不生效的问题
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user