修复:绘制门板时铰链无法和门板关联

pull/2015/head
ChenX 2 years ago
parent 4c4526501c
commit c5c1e2f6c9

@ -634,7 +634,7 @@ export class DrawDoorTool
{
if (!IsHinge(ironware)) continue;
if (!this.IsIntersects(realityBox, otherEnt.Entitys)) continue;
if (!this.IsIntersects(realityBox, [otherEnt])) continue;
if (IsDoor(otherEnt))
{
@ -941,18 +941,25 @@ export class DrawDoorTool
}
}
private IsIntersects(enBox: Box3, checkEnts: Entity[]): boolean
private IsIntersects(enBox: Box3, checkEnts: Entity[], parentOCS?: Matrix4): boolean
{
for (let checkEnt of checkEnts)
{
if (checkEnt instanceof HardwareCompositeEntity)
if (this.IsIntersects(enBox, checkEnt.Entitys))
return true;
else continue;
{
let ocs = checkEnt.OCSNoClone;
if (parentOCS) ocs = new Matrix4().multiplyMatrices(parentOCS, ocs);
let box = checkEnt.BoundingBox as Box3Ext;
if (box.intersectsBox(enBox, 10))
return true;
if (this.IsIntersects(enBox, checkEnt.Entitys, ocs))
return true;
}
else
{
let box = checkEnt.BoundingBox as Box3Ext;
if (parentOCS) box.applyMatrix4(parentOCS);
if (box.intersectsBox(enBox, 10))
return true;
}
}
return false;
}

Loading…
Cancel
Save