From e0a90a2e064f787949b689461a46bf31b0c3016f Mon Sep 17 00:00:00 2001 From: ChenX Date: Tue, 10 Sep 2019 11:46:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=B7=E5=AE=B6=E4=B9=90=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E7=9A=84=E7=BA=B9=E8=B7=AF=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=92=8C=E6=8E=92=E9=92=BB=E9=9D=A2=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/KJLImport.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Add-on/KJLImport.ts b/src/Add-on/KJLImport.ts index 46ef92329..3a15b3daa 100644 --- a/src/Add-on/KJLImport.ts +++ b/src/Add-on/KJLImport.ts @@ -12,6 +12,7 @@ import { Vec2 } from "../Geometry/CheckIntersect"; import { AsVector2, equaln } from "../Geometry/GeUtils"; import { Vec3 } from "../Geometry/IVec3"; import { HotCMD } from "../Hot/HotCommand"; +import { ComposingType, LinesType } from "../UI/Store/BoardInterface"; /** 模型类型 */ enum KJL_ModelType @@ -35,6 +36,9 @@ interface KJL_ParamModel center: Vec3; rotate: Vec3; + TextureName: string; + textureAngle: number; + absPosition: Vec3; absRotation: Vec3; @@ -173,6 +177,7 @@ function ParseModel(model: KJL_ParamModel, roomName: string, gName: string, pare case 1: br.SetBoardType(BoardType.Behind); br.ColorIndex = 3; + br.BoardProcessOption[EBoardKeyList.ComposingFace] = ComposingType.Reverse; break; case 2: br.SetBoardType(BoardType.Layer); @@ -186,6 +191,20 @@ function ParseModel(model: KJL_ParamModel, roomName: string, gName: string, pare if (parentMatrix) mtx.premultiply(parentMatrix); br.ApplyMatrix(new Matrix4().setPosition(0, 0, bmodel.thickness * -0.5).premultiply(mtx)); + + if (br.BoardType === BoardType.Layer) + { + let p = br.Position; + if (p.z > 1500) + br.BoardProcessOption[EBoardKeyList.ComposingFace] = ComposingType.Positive; + else + br.BoardProcessOption[EBoardKeyList.ComposingFace] = ComposingType.Reverse; + } + if (model.textureAngle === 0) + br.BoardProcessOption[EBoardKeyList.Lines] = LinesType.Reverse; + else + br.BoardProcessOption[EBoardKeyList.Lines] = LinesType.Positive; + app.Database.ModelSpace.Append(br); return br; }