Psuedocode:
function isSupported(%pos,%brickData)
{
%bounds = %brickData.brickSize; //Would be a 3 component vector in this case, not sure what .brickSize actually returns
//Check if there is another brick in the current space the new brick is about to occupy
%minorBox = containerFindFirst($TypeMasks::Brick,%pos,getWord(%bounds,0) - 0.01,getWord(%bounds,1) - 0.01,getWord(%bounds,2) - 0.01);
if(%minorBox != 0)
return -1;
//Now check if there is a brick directly above or below the space the new brick is about to occupy
%majorBox = containerFindFirst($TypeMasks::Brick,%pos,getWord(%bounds,0),getWord(%bounds,1),getWord(%bounds,2) + 0.01);
if(%majorBox != 0)
return 1;
return -1;
}
Based mostly on speculation, trying to write this from my iPhone without testing anything in BL