public virtual Portal FindMatchingPortal(Portal portal)
{
// look through all the portals in zone2 for a match
foreach (Portal portal2 in this.mPortals)
{
//portal2 = pi2;
//portal2->updateDerivedValues();
if (portal2.getTargetZone() == null && portal2.closeTo(portal) &&
portal2.getDerivedDirection().Dot(portal.getDerivedDirection()) < -0.9)
{
// found a match!
return(portal2);
}
}
return(null);
}