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

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

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

Loading…
Cancel
Save