Allow all camera rotation axis to be ignored separately during rendering
This commit is contained in:
@@ -523,7 +523,7 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
}
|
||||
options.setMode(pipePreset);
|
||||
|
||||
options.setIgnoreCameraRotation(ignoreCamDir.isChecked());
|
||||
options.setIgnoreCameraRotation(ignoreCamDir.isChecked(), ignoreCamDir.isChecked(), ignoreCamDir.isChecked());
|
||||
|
||||
if (isCtrlKeyDown()) {
|
||||
options.setHighPerformance(true);
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static org.apache.commons.lang3.Validate.isTrue;
|
||||
|
||||
@@ -16,7 +17,10 @@ public final class RenderOptions {
|
||||
|
||||
private File outputFile;
|
||||
|
||||
private boolean ignoreCameraRotation;
|
||||
/**
|
||||
* Whether to ignore camera rotation. On yaw, pitch, roll axis.
|
||||
*/
|
||||
private boolean[] ignoreCameraRotation = new boolean[3];
|
||||
|
||||
// Advanced
|
||||
private boolean waitForChunks = true;
|
||||
@@ -44,12 +48,16 @@ public final class RenderOptions {
|
||||
return skyColor == -1;
|
||||
}
|
||||
|
||||
public void setIgnoreCameraRotation(boolean yaw, boolean pitch, boolean roll) {
|
||||
ignoreCameraRotation = new boolean[]{yaw, pitch, roll};
|
||||
}
|
||||
|
||||
public RenderOptions copy() {
|
||||
RenderOptions copy = new RenderOptions();
|
||||
copy.mode = this.mode;
|
||||
copy.bitrate = this.bitrate;
|
||||
copy.fps = this.fps;
|
||||
copy.ignoreCameraRotation = this.ignoreCameraRotation;
|
||||
copy.ignoreCameraRotation = Arrays.copyOf(this.ignoreCameraRotation, 3);
|
||||
copy.waitForChunks = this.waitForChunks;
|
||||
copy.isLinearMovement = this.isLinearMovement;
|
||||
copy.hideNameTags = this.hideNameTags;
|
||||
|
||||
@@ -373,11 +373,14 @@ public class CustomEntityRenderer<D extends CaptureData> implements eu.crushedpi
|
||||
}
|
||||
|
||||
protected void orientCamera(float partialTicks) {
|
||||
if (options.isIgnoreCameraRotation()) {
|
||||
Entity entity = mc.getRenderViewEntity();
|
||||
// Stop the minecraft code from doing any rotation
|
||||
entity.prevRotationPitch = entity.rotationPitch = 0;
|
||||
Entity entity = mc.getRenderViewEntity();
|
||||
if (options.getIgnoreCameraRotation()[0]) {
|
||||
entity.prevRotationYaw = entity.rotationYaw = 0;
|
||||
}
|
||||
if (options.getIgnoreCameraRotation()[1]) {
|
||||
entity.prevRotationPitch = entity.rotationPitch = 0;
|
||||
}
|
||||
if (options.getIgnoreCameraRotation()[2]) {
|
||||
ReplayHandler.setCameraTilt(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user