add rom volume select
This commit is contained in:
		| @@ -177,10 +177,15 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) | |||||||
|  |  | ||||||
| 		%client.ndSelectionBox = ND_SelectionBox(%shapeName); | 		%client.ndSelectionBox = ND_SelectionBox(%shapeName); | ||||||
|  |  | ||||||
| 		if(%client.ndMultiSelect)  | 		if(%client.ndMultiSelect) { | ||||||
|  | 			if(%obj.getDatablock().isLogicRom) { | ||||||
|  | 				%box = ndGetBoxFromRom(%obj); | ||||||
|  | 			} else { | ||||||
| 				%box = ndGetPlateBoxFromRayCast(%pos, %normal); | 				%box = ndGetPlateBoxFromRayCast(%pos, %normal); | ||||||
| 		else | 			} | ||||||
|  | 		} else { | ||||||
| 			%box = %obj.getWorldBox(); | 			%box = %obj.getWorldBox(); | ||||||
|  | 		} | ||||||
| 		%client.ndInitialMultiSelect = %client.ndMultiSelect; | 		%client.ndInitialMultiSelect = %client.ndMultiSelect; | ||||||
|  |  | ||||||
| 		%p1 = getWords(%box, 0, 2); | 		%p1 = getWords(%box, 0, 2); | ||||||
| @@ -191,6 +196,16 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) | |||||||
| 	%client.ndUpdateBottomPrint(); | 	%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 | //Generic inputs | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo