Skip to content

Commit 418623a

Browse files
committed
Larger viewport offset + Adjust fade
1 parent b57c6d5 commit 418623a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/progressed/ProgMats.java

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public void init(){
9595

9696

9797
if(!TUEnabled()){ //TU already does this, don't double up
98+
//TODO Adjust minZoom based on fov and scale to never result in a negative viewport z.
9899
renderer.minZoom = Math.min(renderer.minZoom, 0.667f); //Zoom out farther
99100
renderer.maxZoom = Math.max(renderer.maxZoom, 24f); //Get a closer look at yourself
100101

src/progressed/graphics/draw3d/Perspective.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Perspective{
1515
/** z values below this are considered on the ground, and bypass calculations. */
1616
private static final float groundTolerance = 0.001f;
1717
/** Viewport offset from the camera height in world units. */
18-
public static float viewportOffset = 16f;
18+
public static float viewportOffset = 80f;
1919
/** Field of View in degrees */
2020
public static float fov = -1f;
2121
public static float fadeDst = 1024f;
@@ -95,7 +95,7 @@ public static float alpha(float x, float y, float z){
9595
}else if(z > vz){ //Behind viewport, should be 0
9696
return 0f;
9797
}else{
98-
return Interp.pow2In.apply(Mathf.clamp(dst / fade));
98+
return Interp.pow5In.apply(Mathf.clamp(dst / fade));
9999
}
100100
}
101101

@@ -107,10 +107,11 @@ public static float cameraZ(){
107107
}
108108

109109
/**
110+
* Never returns a negative, max to 0. If that's happening, calculations are probably breaking, so don't zoom in so much.
110111
* @return viewport z coordinate
111112
*/
112113
public static float viewportZ(){
113-
return cameraZ - viewportOffset;
114+
return Math.max(cameraZ - viewportOffset, 0f);
114115
}
115116

116117
public static Vec3 scaleToViewport(float x, float y, float z){

0 commit comments

Comments
 (0)