Fix camera position off-by-one with immersive portals
This commit is contained in:
@@ -170,15 +170,13 @@ public class RenderBufferHandler implements AutoCloseable
|
||||
int worldMinY = renderParams.clientLevelWrapper.getMinHeight();
|
||||
int worldHeight = renderParams.clientLevelWrapper.getMaxHeight();
|
||||
|
||||
DhVec3d cameraPos = MC_RENDER.getCameraExactPosition();
|
||||
|
||||
renderParams.mcModelViewMatrix.putValuesInArray(JOML_TRANSPOSE_ARRAY);
|
||||
WORLD_VIEW_JOML_MATRIX
|
||||
.setTransposed(JOML_TRANSPOSE_ARRAY)
|
||||
.translate(
|
||||
-(float) cameraPos.x,
|
||||
-(float) cameraPos.y,
|
||||
-(float) cameraPos.z);
|
||||
-(float) renderParams.exactCameraPosition.x,
|
||||
-(float) renderParams.exactCameraPosition.y,
|
||||
-(float) renderParams.exactCameraPosition.z);
|
||||
|
||||
renderParams.dhProjectionMatrix.putValuesInArray(JOML_TRANSPOSE_ARRAY);
|
||||
WORLD_VIEW_PROJ_JOML_MATRIX
|
||||
|
||||
+1
-2
@@ -48,8 +48,7 @@ public abstract class AbstractDebugWireframeRenderer implements IBindable
|
||||
public void render(RenderParams renderParams)
|
||||
{
|
||||
this.dhMvmProjMatrixThisFrame = new DhMat4f(renderParams.dhMvmProjMatrix);
|
||||
DhVec3d camPos = MC_RENDER.getCameraExactPosition();
|
||||
this.camPosFloatThisFrame = new DhVec3f((float) camPos.x, (float) camPos.y, (float) camPos.z);
|
||||
this.camPosFloatThisFrame = new DhVec3f(renderParams.exactCameraPosition);
|
||||
|
||||
|
||||
this.rendererLists.render(this);
|
||||
|
||||
+7
@@ -59,6 +59,13 @@ public interface IMinecraftRenderWrapper extends IBindable
|
||||
*/
|
||||
float getPartialTickTime();
|
||||
|
||||
/**
|
||||
* When other mods are present and
|
||||
* this method is called outside the render thread
|
||||
* this may return undesirable positions.
|
||||
* (Normally this position is used to get
|
||||
* the position the player's camera).
|
||||
*/
|
||||
DhVec3d getCameraExactPosition();
|
||||
|
||||
Color getFogColor(float partialTicks);
|
||||
|
||||
Reference in New Issue
Block a user