Decompiled source of ImprovedCameraMovement v1.0.3

ukmod_improvedcamera.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Fields;
using ULTRAKILL.Portal;
using UnityEngine;
using ukmod_improvedcamera.src.main;
using ukmod_improvedcamera.src.util;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("ukmod_improvedcamera")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ukmod_improvedcamera")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("eaf9a541-f3ca-446e-90b8-e42e924004e9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ukmod_improvedcamera
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct PluginInfo
	{
		public const string PLUGIN_GUID = "com.gunnanthapop.ukmod_improvedcamera";

		public const string PLUGIN_NAME = "Improved Camera Movement";

		public const string PLUGIN_VERSION = "1.0.0";
	}
	public class PluginConfigVar
	{
		public BoolField enabledScreenshake;

		public FloatField screenshakeMaster;

		public FloatField screenshakeFrequency;

		public FloatField screenshakePitch;

		public FloatField screenshakeYaw;

		public FloatField screenshakeRoll;

		public BoolField enabledViewtilt;

		public FloatField viewtiltMaster;

		public FloatField viewtiltPitch;

		public FloatField viewtiltYaw;

		public FloatField viewtiltRoll;

		public FloatField viewtiltRecoveryFrequency;

		public FloatField viewtiltRecoveryDamping;

		public PluginConfigVar(PluginConfigurator config)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Expected O, but got Unknown
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Expected O, but got Unknown
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Expected O, but got Unknown
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Expected O, but got Unknown
			enabledScreenshake = new BoolField(config.rootPanel, "Enabled Screenshake", "enabledScreenshake", true);
			ConfigDivision screenshakeDivision = new ConfigDivision(config.rootPanel, "screenshakeDivision");
			screenshakeMaster = new FloatField((ConfigPanel)(object)screenshakeDivision, "Master", "screenshakeMaster", 1f, 0f, 999f);
			screenshakeFrequency = new FloatField((ConfigPanel)(object)screenshakeDivision, "Frequency", "screenshakeFrequency", 150f, 1f, 999f);
			screenshakePitch = new FloatField((ConfigPanel)(object)screenshakeDivision, "Pitch", "screenshakePitch", 1f, 0f, 1f);
			screenshakeYaw = new FloatField((ConfigPanel)(object)screenshakeDivision, "Yaw", "screenshakeYaw", 1f, 0f, 1f);
			screenshakeRoll = new FloatField((ConfigPanel)(object)screenshakeDivision, "Roll", "screenshakeRoll", 1f, 0f, 1f);
			enabledScreenshake.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)screenshakeDivision).interactable = e.value;
			};
			enabledViewtilt = new BoolField(config.rootPanel, "Enabled Camera tilt", "enabledViewtilt", true);
			ConfigDivision viewtiltDivision = new ConfigDivision(config.rootPanel, "viewtiltDivision");
			viewtiltMaster = new FloatField((ConfigPanel)(object)viewtiltDivision, "Master", "viewtiltMaster", 1f, 0f, 999f);
			viewtiltPitch = new FloatField((ConfigPanel)(object)viewtiltDivision, "Pitch", "viewtiltPitch", 1f, 0f, 1f);
			viewtiltYaw = new FloatField((ConfigPanel)(object)viewtiltDivision, "Yaw", "viewtiltYaw", 1f, 0f, 1f);
			viewtiltRoll = new FloatField((ConfigPanel)(object)viewtiltDivision, "Roll", "viewtiltRoll", 1f, 0f, 1f);
			viewtiltRecoveryFrequency = new FloatField((ConfigPanel)(object)viewtiltDivision, "Recovery Frequency", "viewtiltRecoveryFrequency", 2.5f, 0f, 999f);
			viewtiltRecoveryDamping = new FloatField((ConfigPanel)(object)viewtiltDivision, "Damping Ratio", "viewtiltRecoveryDamping", 0.5f, 0f, 1f);
			enabledViewtilt.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e)
			{
				((ConfigField)viewtiltDivision).interactable = e.value;
			};
		}
	}
	[BepInPlugin("com.gunnanthapop.ukmod_improvedcamera", "Improved Camera Movement", "1.0.0")]
	public class MainPluginModule : BaseUnityPlugin
	{
		public static PluginConfigVar pluginConfigVar;

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			Harmony val = new Harmony("com.gunnanthapop.ukmod_improvedcamera");
			val.PatchAll();
			PluginConfigurator config = PluginConfigurator.Create("Improved Camera Movement", "com.gunnanthapop.ukmod_improvedcamera");
			pluginConfigVar = new PluginConfigVar(config);
		}
	}
}
namespace ukmod_improvedcamera.src.util
{
	public class SpringFloat
	{
		public float frequency = 5f;

		public float dampingRatio = 0.5f;

		public float Target;

		public float Position;

		public float Velocity;

		public SpringFloat(float startingPosition, float target)
		{
			Position = startingPosition;
			Target = target;
			Velocity = 0f;
		}

		public void Reset()
		{
			Position = Target;
			Velocity = 0f;
		}

		public void Update(float deltaTime)
		{
			if (!(deltaTime <= 0f))
			{
				float num = frequency * 2f * (float)Math.PI;
				float num2 = Position - Target;
				float num3 = (0f - num) * num * num2 - 2f * dampingRatio * num * Velocity;
				Velocity += num3 * deltaTime;
				Position += Velocity * deltaTime;
			}
		}
	}
	public class SpringVector3
	{
		public float frequency = 5f;

		public float dampingRatio = 0.5f;

		public Vector3 Target;

		public Vector3 Position;

		public Vector3 Velocity;

		public SpringVector3(Vector3 startingPosition, Vector3 target)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			Position = startingPosition;
			Target = target;
			Velocity = Vector3.zero;
		}

		public void Reset()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Position = Target;
			Velocity = Vector3.zero;
		}

		public void Update(float deltaTime)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			if (!(deltaTime <= 0f))
			{
				float num = frequency * 2f * (float)Math.PI;
				Vector3 val = Position - Target;
				Vector3 val2 = (0f - num) * num * val - 2f * dampingRatio * num * Velocity;
				Velocity += val2 * deltaTime;
				Position += Velocity * deltaTime;
			}
		}
	}
}
namespace ukmod_improvedcamera.src.patches
{
	[HarmonyPatch(typeof(Revolver), "Shoot")]
	internal class RevolverPatches
	{
		private static void Postfix(Revolver __instance, int shotType)
		{
			float num = 0.25f;
			if (__instance.altVersion)
			{
				num *= 2f;
			}
			if (shotType == 2)
			{
				num *= 2f;
			}
			MonoSingleton<CameraMovementController>.Instance.camShakeEffect.StartBasicShake(num);
		}
	}
}
namespace ukmod_improvedcamera.src.patches.newmovementpatches
{
	[HarmonyPatch(typeof(NewMovement), "OnTravel")]
	internal class OnTravelPatch
	{
		private static void Postfix(NewMovement __instance, PortalTravelDetails details)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			MonoSingleton<CameraMovementController>.Instance.viewRollEffect.OnPortalTravesal(details);
		}
	}
	[HarmonyPatch(typeof(NewMovement), "Awake")]
	internal class AwakePatch
	{
		private static void Postfix(NewMovement __instance)
		{
			__instance.rb.interpolation = (RigidbodyInterpolation)1;
		}
	}
}
namespace ukmod_improvedcamera.src.patches.cameracontroller
{
	[HarmonyPatch(typeof(CameraController), "Awake")]
	internal class AwakePatch
	{
		private static void Postfix(CameraController __instance)
		{
			((Component)__instance).gameObject.AddComponent<CameraMovementController>();
		}
	}
	[HarmonyPatch(typeof(CameraController), "LateUpdate")]
	internal class LateUpdatePatch
	{
		private static void Postfix(CameraController __instance)
		{
			__instance.StopShake();
			__instance.tiltRotationZ = 0f;
			__instance.tiltRotationZSmooth = 0f;
		}
	}
	[HarmonyPatch(typeof(CameraController), "CameraShake")]
	internal class CameraShakePatch
	{
		private static void Prefix(float shakeAmount)
		{
			MonoSingleton<CameraMovementController>.Instance.camShakeEffect.StartBasicShake(shakeAmount);
		}
	}
	[HarmonyPatch(typeof(CameraController), "ApplyRotations")]
	internal class ApplyRotationsPatch
	{
		private static bool Prefix(CameraController __instance)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = MonoSingleton<CameraMovementController>.Instance.FinalResult;
			if (GameStateManager.Instance.CameraLocked)
			{
				val = Vector3.zero;
			}
			__instance.player.transform.localRotation = __instance.gravityRotation * Quaternion.AngleAxis(__instance.rotationY, Vector3.up);
			MonoSingleton<NewMovement>.Instance.rb.rotation = __instance.player.transform.rotation;
			((Component)__instance).transform.localRotation = Quaternion.AngleAxis(0f - __instance.rotationX, Vector3.right) * Quaternion.AngleAxis(__instance.transitionRotationZ, Vector3.forward) * Quaternion.AngleAxis(__instance.tiltRotationZ, Vector3.forward) * __instance.rotationOffset * Quaternion.Euler(val);
			((Component)__instance.hudCamera).transform.GetChild(0).localRotation = Quaternion.Euler(-val);
			return false;
		}
	}
}
namespace ukmod_improvedcamera.src.main
{
	public class CameraMovementController : MonoSingleton<CameraMovementController>
	{
		public Vector3 FinalResult;

		public List<Vector3> currentFrameVectorList = new List<Vector3>();

		public CameraShakeEffect camShakeEffect;

		public ViewRollEffect viewRollEffect;

		private void Awake()
		{
			camShakeEffect = ((Component)this).gameObject.AddComponent<CameraShakeEffect>();
			viewRollEffect = ((Component)this).gameObject.AddComponent<ViewRollEffect>();
		}

		private void Update()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.zero;
			foreach (Vector3 currentFrameVector in currentFrameVectorList)
			{
				val += currentFrameVector;
			}
			currentFrameVectorList.Clear();
			FinalResult = val;
		}
	}
	public class CameraShakeInstance
	{
		public float Amplitude;

		public float Frequency;

		public float Duration;

		public float FadeInDuration;

		public float FadeOutDuration;

		public float Age;

		public bool IsDestroyed()
		{
			return Age > Duration;
		}

		public CameraShakeInstance(float amplitude, float frequency, float duration, float fadeIn, float fadeOut)
		{
			Amplitude = amplitude;
			Frequency = frequency;
			Duration = duration;
			FadeInDuration = fadeIn;
			FadeOutDuration = fadeOut;
			Age = 0f;
		}

		public void Update(float deltaTime)
		{
			Age += deltaTime;
		}

		public Vector3 GetCurrentOffset()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			if (IsDestroyed())
			{
				return Vector3.zero;
			}
			float num = Age * Frequency;
			float num2 = Mathf.Sin(num) * MainPluginModule.pluginConfigVar.screenshakePitch.value;
			float num3 = Mathf.Cos(num / 2f) * MainPluginModule.pluginConfigVar.screenshakeYaw.value;
			float num4 = Mathf.Sin(num / 2f) * MainPluginModule.pluginConfigVar.screenshakeRoll.value;
			float num5 = 1f;
			if (Age < FadeInDuration)
			{
				num5 = Age / FadeInDuration;
			}
			else if (Age > Duration - FadeOutDuration)
			{
				float num6 = Duration - Age;
				num5 = num6 / FadeOutDuration;
			}
			return new Vector3(num2, num3, num4) * Amplitude * num5;
		}
	}
	public class CameraShakeEffect : MonoBehaviour
	{
		private List<CameraShakeInstance> activeShakes = new List<CameraShakeInstance>();

		public void StartBasicShake(float shakeAmount)
		{
			CameraShakeInstance item = new CameraShakeInstance(shakeAmount / 2f, MainPluginModule.pluginConfigVar.screenshakeFrequency.value, Mathf.Max(shakeAmount / 3f, 0.5f), 0.05f, 0.275f);
			activeShakes.Add(item);
		}

		public void StartShake(float amplitude, float frequency, float duration, float fadein, float fadeout)
		{
			CameraShakeInstance item = ((frequency != -1f) ? new CameraShakeInstance(amplitude, frequency, duration, fadein, fadeout) : new CameraShakeInstance(amplitude, MainPluginModule.pluginConfigVar.screenshakeFrequency.value, duration, fadein, fadeout));
			activeShakes.Add(item);
		}

		private void Update()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.zero;
			for (int num = activeShakes.Count - 1; num >= 0; num--)
			{
				CameraShakeInstance cameraShakeInstance = activeShakes[num];
				cameraShakeInstance.Update(Time.unscaledDeltaTime);
				if (cameraShakeInstance.IsDestroyed())
				{
					activeShakes.RemoveAt(num);
				}
				else
				{
					val += cameraShakeInstance.GetCurrentOffset();
				}
			}
			val *= MainPluginModule.pluginConfigVar.screenshakeMaster.value;
			if (MainPluginModule.pluginConfigVar.enabledScreenshake.value)
			{
				MonoSingleton<CameraMovementController>.Instance.currentFrameVectorList.Add(val);
			}
		}
	}
	public class ViewRollEffect : MonoBehaviour
	{
		private Rigidbody rb;

		private Vector3 previousRBPosition;

		private Vector3 currentRBPosition;

		private SpringVector3 trackingSpring = new SpringVector3(Vector3.zero, Vector3.zero);

		private Vector3 SpringOffsetBeforePortal;

		private void Awake()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			rb = ((Component)((Component)this).transform.parent).GetComponent<Rigidbody>();
			previousRBPosition = rb.position;
			currentRBPosition = rb.position;
		}

		private void Start()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			trackingSpring.Position = rb.position;
		}

		private void FixedUpdate()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			previousRBPosition = currentRBPosition;
			currentRBPosition = rb.position;
		}

		public Vector3 GetInterpolatedPosition(Vector3 prev, Vector3 cur)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			float num = (Time.time - Time.fixedTime) / Time.fixedDeltaTime;
			num = Mathf.Clamp01(num);
			return Vector3.Lerp(prev, cur, num);
		}

		private void Update()
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			trackingSpring.frequency = MainPluginModule.pluginConfigVar.viewtiltRecoveryFrequency.value;
			trackingSpring.dampingRatio = MainPluginModule.pluginConfigVar.viewtiltRecoveryDamping.value;
			trackingSpring.Target = GetInterpolatedPosition(previousRBPosition, currentRBPosition);
			trackingSpring.Update(Time.deltaTime);
			float num = Vector3.Dot(trackingSpring.Position - trackingSpring.Target, ((Component)this).transform.up) * MainPluginModule.pluginConfigVar.viewtiltPitch.value;
			float num2 = Vector3.Dot(trackingSpring.Position - trackingSpring.Target, ((Component)this).transform.right) * -0.5f * MainPluginModule.pluginConfigVar.viewtiltYaw.value;
			float num3 = Vector3.Dot(trackingSpring.Position - trackingSpring.Target, ((Component)this).transform.right) * MainPluginModule.pluginConfigVar.viewtiltRoll.value;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num, num2, num3);
			val *= MainPluginModule.pluginConfigVar.viewtiltMaster.value;
			if (MainPluginModule.pluginConfigVar.enabledViewtilt.value)
			{
				MonoSingleton<CameraMovementController>.Instance.currentFrameVectorList.Add(val);
			}
			SpringOffsetBeforePortal = trackingSpring.Position - trackingSpring.Target;
		}

		public void OnPortalTravesal(PortalTravelDetails details)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			trackingSpring.Position = rb.position + SpringOffsetBeforePortal;
			trackingSpring.Target = rb.position;
			previousRBPosition = rb.position;
			currentRBPosition = rb.position;
		}
	}
}