|
|
|
@ -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 =>
|
|
|
|
|
{
|
|
|
|
|