Skip to content

Commit

Permalink
better zoom adjustment based on multi size
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed May 5, 2024
1 parent 823200c commit 6659dda
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,11 @@ protected void initializeSceneRenderer(boolean resetCamera) {
setNextLayer(layerIndex);

if (resetCamera) {
float max = Math.max(Math.max(Math.max(size.x, size.y), size.z), 1);
// Compact Series multiblocks compat
if (size.x >= 30 || size.y >= 30 || size.z >= 30) {
zoom = (float) (DEFAULT_RANGE_MULTIPLIER * 4 * Math.sqrt(max));
}
// Mega Series multiblocks compat
if (size.x >= 15 && size.y >= 15 && size.z >= 11) {
zoom = (float) (DEFAULT_RANGE_MULTIPLIER * 2 * Math.sqrt(max));
} else {
zoom = (float) (DEFAULT_RANGE_MULTIPLIER * Math.sqrt(max));
}
float max = Math.max(Math.max(size.x, size.y), size.z);
float baseZoom = (float) (DEFAULT_RANGE_MULTIPLIER * Math.sqrt(max));
float sizeFactor = (float) (1.0f + Math.log(max) / Math.log(10));

zoom = baseZoom * sizeFactor / 1.5f;
rotationYaw = 20.0f;
rotationPitch = 50f;
if (renderer != null) {
Expand Down

0 comments on commit 6659dda

Please sign in to comment.