Finding a camera position that gets 1..n spatials in the camera viewport

Hello

As the topic says, does the camera in JME have a way to position it self so as to be able to contain a specific set of spatials in its viewport.

For example, I want to create function that allows the player to see the selected units in the bottom of the screen, with some information about the unit(s) displayed etc. A player may select 1 to 20 units, so it would position itself differently when it was 1 unit, than when it was 20 units.

Kind regards,
Asser

General approach:
-calculate the maximum bounds in x and y
-clamp these to the same ratio as the camera
-multiply half the clamped y value with cam.getViewProjectionMatrix().m11 to get the z value that will get them all in view

Similar to what I do when setting up the camera for tree atlases in SimArboreal:
https://code.google.com/p/simsilica-tools/source/browse/trunk/SimArboreal-Editor/src/main/java/com/simsilica/arboreal/AtlasGeneratorState.java#441