From 2ba7aec8479e1cfaa9e0b6a29232d074c0ce2b7f Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Sat, 5 Sep 2015 17:45:22 +0200 Subject: [PATCH] Added SpectatingMethod attribute to SpectatorData object, and more variables for the SHOULDER_CAM SpectatingMethod --- .../replaymod/holders/SpectatorData.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/main/java/eu/crushedpixel/replaymod/holders/SpectatorData.java b/src/main/java/eu/crushedpixel/replaymod/holders/SpectatorData.java index 817f4307..06520b69 100755 --- a/src/main/java/eu/crushedpixel/replaymod/holders/SpectatorData.java +++ b/src/main/java/eu/crushedpixel/replaymod/holders/SpectatorData.java @@ -3,17 +3,43 @@ package eu.crushedpixel.replaymod.holders; import eu.crushedpixel.replaymod.interpolation.AdvancedPositionLinearInterpolation; import eu.crushedpixel.replaymod.interpolation.AdvancedPositionSplineInterpolation; import eu.crushedpixel.replaymod.interpolation.Interpolation; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; +@Data @NoArgsConstructor @EqualsAndHashCode(callSuper=true) public class SpectatorData extends AdvancedPosition { private Integer spectatedEntityID; + private SpectatingMethod spectatingMethod = SpectatingMethod.FIRST_PERSON; + + //these fields are only relevant for SpectatingMethod.SHOULDER_CAM + /** + * The shoulder camera's distance (in blocks) to the player + */ + private double shoulderCamDistance = 3; + + /** + * The shoulder camera's pitch offset in degrees, value between -90 and 90 + */ + private float shoulderCamPitchOffset = 0; + + /** + * The shoulder camera's rotation around the player in degrees + */ + private float shoulderCamYawOffset = 0; + + /** + * The distance between the automatically calculated position keyframes in milliseconds + */ + private int shoulderCamSmoothness = 500; + + public int getSpectatedEntityID() { if(spectatedEntityID == null) throw new IllegalStateException(); return spectatedEntityID; @@ -56,4 +82,8 @@ public class SpectatorData extends AdvancedPosition { public Interpolation getLinearInterpolator() { return new AdvancedPositionLinearInterpolation(); } + + public enum SpectatingMethod { + FIRST_PERSON, SHOULDER_CAM + } }