-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nothing added, it just works.
- Loading branch information
Showing
6 changed files
with
98 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
CameraAdditions/Patches/Assembly-CSharp/AbstractCamMode/CamModeLateUpdate.cs
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
CameraAdditions/Patches/Assembly-CSharp/ChaseCamMode/CamModeLateUpdate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using HarmonyLib; | ||
|
||
namespace CameraAdditions.Patches | ||
{ | ||
[HarmonyPatch(typeof(ChaseCamMode), "CamModeLateUpdate")] | ||
internal static class ChaseCamMode__CamModeLateUpdate | ||
{ | ||
[HarmonyPrefix] | ||
internal static void PositionPrefix(ChaseCamMode __instance) | ||
{ | ||
float zoomOffset; | ||
//This is to prevent a super glitchy camera when zooming in too far | ||
if (Mod.ZoomOffset.Value < -3f) | ||
zoomOffset = -3f; | ||
else | ||
zoomOffset = Mod.ZoomOffset.Value; | ||
|
||
__instance.maxDistanceLowSpeed_ = Mod.Instance.maxDistanceLowSpeed + zoomOffset; | ||
__instance.maxDistanceHighSpeed_ = Mod.Instance.maxDistanceHighSpeed + zoomOffset; | ||
__instance.minDistance_ = Mod.Instance.minDistance + zoomOffset; | ||
__instance.height_ = Mod.Instance.height + (zoomOffset / 4.5f); | ||
|
||
if (Mod.LockCameraPosition.Value) | ||
{ | ||
__instance.maxDistanceLowSpeed_ = __instance.maxDistanceHighSpeed_; | ||
} | ||
} | ||
|
||
[HarmonyPostfix] | ||
internal static void PositionPostfix(ChaseCamMode __instance) | ||
{ | ||
__instance.transform.position += __instance.transform.right * Mod.XOffset.Value; | ||
__instance.transform.position += __instance.transform.up * Mod.YOffset.Value; | ||
|
||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.ZRotationOffset.Value, UnityEngine.Vector3.forward); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.XRotationOffset.Value, UnityEngine.Vector3.right); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.YRotationOffset.Value, UnityEngine.Vector3.up); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
CameraAdditions/Patches/Assembly-CSharp/CockpitCamMode/CamModeLateUpdate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using HarmonyLib; | ||
|
||
namespace CameraAdditions.Patches | ||
{ | ||
[HarmonyPatch(typeof(CockpitCamMode), "CamModeLateUpdate")] | ||
internal static class CockpitCamMode__CamModeLateUpdate | ||
{ | ||
[HarmonyPostfix] | ||
internal static void PositionPostfix(CockpitCamMode __instance) | ||
{ | ||
__instance.transform.position += __instance.transform.right * (Mod.XOffset.Value / 10); | ||
__instance.transform.position += __instance.transform.up * (Mod.YOffset.Value / 10); | ||
__instance.transform.position += __instance.transform.forward * (Mod.ZoomOffset.Value / 10); | ||
|
||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.ZRotationOffset.Value, UnityEngine.Vector3.forward); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.XRotationOffset.Value, UnityEngine.Vector3.right); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.YRotationOffset.Value, UnityEngine.Vector3.up); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
CameraAdditions/Patches/Assembly-CSharp/MountedCamMode/CamModeLateUpdate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using HarmonyLib; | ||
|
||
namespace CameraAdditions.Patches | ||
{ | ||
[HarmonyPatch(typeof(MountedCamMode), "CamModeLateUpdate")] | ||
internal static class MountedCamMode__CamModeLateUpdate | ||
{ | ||
[HarmonyPostfix] | ||
internal static void PositionPostfix(CockpitCamMode __instance) | ||
{ | ||
__instance.transform.position += __instance.transform.right * (Mod.XOffset.Value / 10); | ||
__instance.transform.position += __instance.transform.up * (Mod.YOffset.Value / 10); | ||
__instance.transform.position += __instance.transform.forward * (Mod.ZoomOffset.Value / 10); | ||
|
||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.ZRotationOffset.Value, UnityEngine.Vector3.forward); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.XRotationOffset.Value, UnityEngine.Vector3.right); | ||
__instance.transform.rotation *= UnityEngine.Quaternion.AngleAxis(Mod.YRotationOffset.Value, UnityEngine.Vector3.up); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters