	-- further, limit pos to avoid ko zones:
	for i in 1..nko loop
	if (i /= pko) or not inpool(oxme,oyme,ozme) then

		kxl:=xme-koxlo(i)+margin;
		kxh:=koxhi(i)+margin-xme;

		--NOTE:  using half-height for this test to
		--       respect low obstacles like sokWalls.
		kyl:=yme-aheight/2.0-koylo(i);
		kyh:=koyhi(i)-yme+aheight/2.0;

		kzl:=zme-kozlo(i)+margin;
		kzh:=kozhi(i)+margin-zme;



		if (kxl*kxh>0.0) and (kyl*kyh>0.0) and (kzl*kzh>0.0) then 
		--intrusion into ko

			okxl:=oxme-koxlo(i)+margin;
			okxh:=koxhi(i)+margin-oxme;
			okzl:=ozme-kozlo(i)+margin;
			okzh:=kozhi(i)+margin-ozme;

			if      ( (okxl*okxh>0.0) and (okzl*okzh<=0.0) ) then
				zme:=ozme;

			elsif ( (okzl*okzh>0.0) and (okxl*okxh<=0.0) ) then
				xme:=oxme;

			end if;

		end if; --intrusion into ko



	end if;
	end loop; --for i


