add select zone by ctrl-selectingt zone brick
This commit is contained in:
parent
0a9bee8d60
commit
cd5b46cc3b
@ -161,6 +161,7 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
%client.ndSelectionBox.ez_zoneBrick = "";
|
||||||
%box = %obj.getWorldBox();
|
%box = %obj.getWorldBox();
|
||||||
%p1 = getWords(%box, 0, 2);
|
%p1 = getWords(%box, 0, 2);
|
||||||
%p2 = getWords(%box, 3, 5);
|
%p2 = getWords(%box, 3, 5);
|
||||||
@ -180,6 +181,9 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal)
|
|||||||
if(%client.ndMultiSelect) {
|
if(%client.ndMultiSelect) {
|
||||||
if(%obj.getDatablock().isLogicRom) {
|
if(%obj.getDatablock().isLogicRom) {
|
||||||
%box = ndGetBoxFromRom(%obj);
|
%box = ndGetBoxFromRom(%obj);
|
||||||
|
} else if (isObject(%obj.physicalZone)) {
|
||||||
|
%box = ndGetBoxFromZone(%obj);
|
||||||
|
%client.ndSelectionBox.ez_zoneBrick = %obj;
|
||||||
} else {
|
} else {
|
||||||
%box = ndGetPlateBoxFromRayCast(%pos, %normal);
|
%box = ndGetPlateBoxFromRayCast(%pos, %normal);
|
||||||
}
|
}
|
||||||
@ -206,6 +210,15 @@ function ndGetBoxFromRom(%b) {
|
|||||||
return %bl SPC %bh;
|
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
|
//Generic inputs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user