|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import { Color, MeshPhysicalMaterial } from "three";
|
|
|
|
|
import { USE_WORLD_UV, U_WORLD_MOVE, U_WORLD_REP, U_WORLD_RO, V_WORLD_MOVE, V_WORLD_REP } from "../Add-on/testEntity/USE_WORLD_UV";
|
|
|
|
|
import { HostApplicationServices } from "../ApplicationServices/HostApplicationServices";
|
|
|
|
|
import { AutoRecord } from "./AutoRecord";
|
|
|
|
|
import { Factory } from "./CADFactory";
|
|
|
|
@ -80,6 +81,14 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
|
|
|
|
|
|
|
|
|
|
@AutoRecord sharpen = 1;//锐化 默认1 范围0-20 默认折叠
|
|
|
|
|
|
|
|
|
|
get UseWorldUV() { return this.UVType === UVType.WorldUV; }
|
|
|
|
|
set UseWorldUV(b: boolean) { this.UVType = b ? UVType.WorldUV : UVType.LocalUV; }
|
|
|
|
|
|
|
|
|
|
@AutoRecord UWroldRep = 1;
|
|
|
|
|
@AutoRecord VWroldRep = 1;
|
|
|
|
|
@AutoRecord UWroldRo = 0;
|
|
|
|
|
@AutoRecord UWorldMove = 0;
|
|
|
|
|
@AutoRecord VWorldMove = 0;
|
|
|
|
|
|
|
|
|
|
@AutoRecord depthTest: boolean = true;//深度测试(默认true)(弃用(不在UI上显示)
|
|
|
|
|
|
|
|
|
@ -91,6 +100,18 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
|
|
|
|
|
private material = new MeshPhysicalMaterial({});
|
|
|
|
|
async Update()
|
|
|
|
|
{
|
|
|
|
|
this.material[USE_WORLD_UV] = this.UseWorldUV;
|
|
|
|
|
if (this.material[USE_WORLD_UV])
|
|
|
|
|
{
|
|
|
|
|
this.material[U_WORLD_REP] = this.UWroldRep;
|
|
|
|
|
this.material[V_WORLD_REP] = this.VWroldRep;
|
|
|
|
|
|
|
|
|
|
this.material[U_WORLD_RO] = this.UWroldRo;
|
|
|
|
|
|
|
|
|
|
this.material[U_WORLD_MOVE] = this.UWorldMove;
|
|
|
|
|
this.material[V_WORLD_MOVE] = this.VWorldMove;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!this.material.color)
|
|
|
|
|
this.material.color = new Color(this.color);
|
|
|
|
|
else
|
|
|
|
@ -266,6 +287,15 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
|
|
|
|
|
this.type = file.Read();
|
|
|
|
|
if (ver > 7)
|
|
|
|
|
this.ref = file.Read();
|
|
|
|
|
|
|
|
|
|
if (ver > 8)
|
|
|
|
|
{
|
|
|
|
|
this.UWroldRep = file.Read();
|
|
|
|
|
this.VWroldRep = file.Read();
|
|
|
|
|
this.UWroldRo = file.Read();
|
|
|
|
|
this.UWorldMove = file.Read();
|
|
|
|
|
this.VWorldMove = file.Read();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.Update();
|
|
|
|
@ -274,7 +304,7 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
|
|
|
|
|
WriteFile(file: CADFiler)
|
|
|
|
|
{
|
|
|
|
|
super.WriteFile(file);
|
|
|
|
|
file.Write(8);
|
|
|
|
|
file.Write(9);
|
|
|
|
|
file.Write(this.color);
|
|
|
|
|
file.Write(this.transparent);
|
|
|
|
|
file.Write(this.matalness);
|
|
|
|
@ -335,6 +365,13 @@ export class PhysicalMaterialRecord extends MaterialTableRecord
|
|
|
|
|
|
|
|
|
|
//ver8
|
|
|
|
|
file.Write(this.ref);
|
|
|
|
|
|
|
|
|
|
//ver9
|
|
|
|
|
file.Write(this.UWroldRep);
|
|
|
|
|
file.Write(this.VWroldRep);
|
|
|
|
|
file.Write(this.UWroldRo);
|
|
|
|
|
file.Write(this.UWorldMove);
|
|
|
|
|
file.Write(this.VWorldMove);
|
|
|
|
|
}
|
|
|
|
|
//#endregion
|
|
|
|
|
}
|
|
|
|
|