add rom volume select

This commit is contained in:
Redo 2022-11-29 14:32:30 -06:00
parent 3c87c8f7d9
commit 0a9bee8d60
2 changed files with 19 additions and 4 deletions

View File

@ -177,10 +177,15 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
%client.ndSelectionBox = ND_SelectionBox(%shapeName);
if(%client.ndMultiSelect)
%box = ndGetPlateBoxFromRayCast(%pos, %normal);
else
if(%client.ndMultiSelect) {
if(%obj.getDatablock().isLogicRom) {
%box = ndGetBoxFromRom(%obj);
} else {
%box = ndGetPlateBoxFromRayCast(%pos, %normal);
}
} else {
%box = %obj.getWorldBox();
}
%client.ndInitialMultiSelect = %client.ndMultiSelect;
%p1 = getWords(%box, 0, 2);
@ -191,6 +196,16 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
%client.ndUpdateBottomPrint();
}
function ndGetBoxFromRom(%b) {
%db = %b.getDatablock();
%box = %b.getWorldBox();
%bl = getWords(%box, 0, 2);
%bh = getWords(%box, 3, 5);
%bl = vectorAdd(%bl, "0 0 " SPC (%db.brickSizeZ * 0.2));
%bh = vectorAdd(%bh, "0 0 " SPC (%db.logicRomZ * 0.2));
return %bl SPC %bh;
}
//Generic inputs

View File

@ -1505,7 +1505,7 @@ function ND_Selection::tickSuperCutChunk(%this)
%bricksPlanted += $ND::FillBrickCount;
}
//Set next chunk index or break
%currChunk++;