修复:复合实体规格错误

pull/1559/MERGE
ChenX 3 years ago
parent 1fe3774cb4
commit 49f50a94ec

@ -24,8 +24,16 @@ export class CompositeEntity extends Entity
//如果你需要修改内部实体,则需要写入记录
@AutoRecord Entitys: Entity[] = [];
/**
* Box
*/
override get BoundingBoxInOCS(): Box3Ext
{
return this.GetBoundingBoxInMtx(this.OCSInv);
}
//因为复合实体特性的关系,所以Entity.GetBoundingBoxInMtx实现会错误,因为修改这个实体的矩阵并不会影响子实体的包围盒(在布局状态下,实体可能被复用),所以用重载看起来没问题
GetBoundingBoxInMtx(mtx: Matrix4): Box3Ext
override GetBoundingBoxInMtx(mtx: Matrix4): Box3Ext
{
return new Box3Ext().copy(this.BoundingBox).applyMatrix4(mtx);
}
@ -35,7 +43,7 @@ export class CompositeEntity extends Entity
/**
* threejs,.
*/
Explode()
override Explode()
{
return this.Entitys.map(e =>
{

Loading…
Cancel
Save