function doStuff( %vec0, %vec1, %mask )
{
%center = vectorAdd( %vec0, vectorScale( vectorSub( %vec1, %vec0 ), 0.5 ) );
initContainerRadiusSearch( %center, vectorDist( %vec0, %vec1 ) * 4, %mask );
while ( isObject( %obj = containerSearchNext() )
{
%pos = %obj.getPosition();
%dif0 = vectorSub( %pos, %vec0 );
%dif1 = vectorSub( %pos, %vec1 );
if ( getWord( %dif0, 0 ) < 0 || getWord( %dif0, 1 ) < 0 || getWord( %dif1, 2 ) < 0 )
{
continue;
}
if ( getWord( %dif1, 0 ) < 0 || getWord( %dif1, 1 ) < 0 || getWord( %dif1, 2 ) < 0 )
{
continue;
}
// do stuff with %obj
}
}
There is probably a more efficient way, but this should work. Also, this code assumes that the first point is on the negative axis (e.g. 2 2 2 and 4 4 4, not 4 4 4 and 2 2 2, but that's an easy fix anyway).