Skip to content

Commit dcaa9b7

Browse files
committed
Lower min viewport z
1 parent b9ecb8e commit dcaa9b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/progressed/graphics/draw3d/Perspective.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public class Perspective{
1616
private static final float groundTolerance = 0.001f;
1717
/** Viewport offset from the camera height in world units. */
1818
public static float viewportOffset = 80f;
19+
/** Minimum z value for the viewport. */
20+
public static float minViewportZ = 20f;
1921
/** Field of View in degrees */
2022
public static float fov = -1f;
2123
public static float fadeDst = 1024f;
@@ -132,7 +134,7 @@ public static float dstToViewport(float x, float y, float z){
132134
}
133135

134136
public static float maxZoom(){
135-
float minCZ = viewportOffset * 2f;
137+
float minCZ = minViewportZ + viewportOffset;
136138
float minWidth = (float)(minCZ * Math.tan(fov / 2f * Mathf.degRad)) * 2f;
137139
float maxScale = Math.max(Core.graphics.getHeight(), Core.graphics.getWidth()) / minWidth;
138140

0 commit comments

Comments
 (0)