add select zone by ctrl-selectingt zone brick

This commit is contained in:
Redo 2024-01-22 02:16:07 -06:00
parent 0a9bee8d60
commit cd5b46cc3b

View File

@ -161,6 +161,7 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
}
else
{
%client.ndSelectionBox.ez_zoneBrick = "";
%box = %obj.getWorldBox();
%p1 = getWords(%box, 0, 2);
%p2 = getWords(%box, 3, 5);
@ -180,6 +181,9 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
if(%client.ndMultiSelect) {
if(%obj.getDatablock().isLogicRom) {
%box = ndGetBoxFromRom(%obj);
} else if (isObject(%obj.physicalZone)) {
%box = ndGetBoxFromZone(%obj);
%client.ndSelectionBox.ez_zoneBrick = %obj;
} else {
%box = ndGetPlateBoxFromRayCast(%pos, %normal);
}
@ -206,6 +210,15 @@ function ndGetBoxFromRom(%b) {
return %bl SPC %bh;
}
function ndGetBoxFromZone(%b) {
%z = %b.physicalZone;
%pos = %z.position;
%scale = %z.getScale(); %sx = getWord(%scale, 0); %sy = getWord(%scale, 1); %sz = getWord(%scale, 2);
%bl = %pos;
%bh = vectorAdd(%pos, %sx SPC (-%sy) SPC %sz);
return %bl SPC %bh;
}
//Generic inputs