酷家乐导入实体的纹路解析和排钻面设置

pull/488/MERGE
ChenX 5 years ago
parent 8ac0767958
commit e0a90a2e06

@ -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;
}

Loading…
Cancel
Save