修复:ZoomObject对复合实体(扫略实体)时错误

pull/1552/MERGE
ChenX 3 years ago
parent 0cbf602811
commit 9f10624ff6

@ -4,7 +4,6 @@ import { arraySortByNumber, arraySum } from "../../Common/ArrayExt";
import { Object3DRemoveAll } from "../../Common/Dispose";
import { UpdateDraw } from "../../Common/Status";
import { ObjectSnapMode } from "../../Editor/ObjectSnapMode";
import { Box3Ext } from "../../Geometry/Box";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { AutoRecord } from "../AutoRecord";
import { Factory } from "../CADFactory";
@ -49,13 +48,17 @@ export class CompositeEntity extends Entity
callback(en);
}
}
get BoundingBox()
{
let box = new Box3Ext();
for (let e of this.Entitys)
box.union(e.BoundingBox);
return box.applyMatrix4(this.OCS);
}
//实体在被内嵌时,它绘制对象的世界矩阵会被影响,所以这里我们不直接计算它的盒子,而是用绘制对象的盒子来计算包围盒,避免错误
//例如 复合扫略实体 的ZoomObject在这个实现下是错误的(因为扫略实体也是直接取绘制对象的包围盒)
// get BoundingBox()
// {
// let box = new Box3Ext();
// for (let e of this.Entitys)
// box.union(e.BoundingBox);
// return box.applyMatrix4(this.OCSNoClone);
// }
protected InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D
{
/**

Loading…
Cancel
Save