修复:镜像的引用实体在渲染器位置错误

pull/1939/head
ChenX 2 years ago
parent 5dd0fe90b6
commit f66e1f9f5e

@ -12,6 +12,7 @@ import { Log } from "../Common/Log";
import { Vector2ApplyMatrix4 } from "../Common/Matrix4Utils";
import { StoreageKeys } from '../Common/StoreageKeys';
import { copyTextToClipboard } from "../Common/Utils";
import { IsMirror } from '../csg/core/math/IsMirrot';
import { CylinderHole } from '../DatabaseServices/3DSolid/CylinderHole';
import { ExtrudeHole } from '../DatabaseServices/3DSolid/ExtrudeHole';
import { RevolveSolid } from '../DatabaseServices/3DSolid/RevolveSolid';
@ -361,8 +362,17 @@ function ConveEntityRef2Data(e: EntityRef)
ref.Id = e.Id?.Index ?? 0;
ref.Type = "Ref";
ref.Url = e.Url;
ref.OCS = e.OCS.toArray();
ref.OCS = e.OCSNoClone.toArray();
ref.Scale = e.Scale.toArray();
if (IsMirror(e.OCSNoClone))
{
ref.OCS[8] *= -1;
ref.OCS[9] *= -1;
ref.OCS[10] *= -1;
ref.Scale[2] *= -1;
}
//由于我们是右手坐标系,在UE导出资源的时候,已经自动个转换,所以我们在这里改变它,以便在UE里面能正确的还原
ref.OCS[4] *= -1;
ref.OCS[5] *= -1;

Loading…
Cancel
Save