I want to see if a brick is close to another but this brick doesn't know the position of the other bricks. I have two options. Container search and looking through every brick in the brickgroup and testing the distance manually.
Which would be more efficient for a rather large amount of bricks? Also, I'm trying to do the boxsearch but it just detects the brick that's calling it (i.e. using the brick who's position is the same as the container's search center)
%rad = getBiggestSize(%brick)*2; //forget this for now, return 8
initContainerBoxSearch(%brick.getPosition(),"\"" @ %rad SPC %rad SPC %rad @ "\"",$TypeMasks::FxBrickObjectType);
while(%searchObject = containerSearchNext()) {
echo(%searchObject);
and %brick.getID() == %searchObject.getID().