using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x0200047A RID: 1146
	[Token(Token = "0x200047A")]
	[Serializable]
	public abstract class IKSolver
	{
		// Token: 0x060028A1 RID: 10401 RVA: 0x0005C7C0 File Offset: 0x0005A9C0
		[Token(Token = "0x60028A1")]
		[Address(RVA = "0x17129C0", Offset = "0x17119C0", VA = "0x1817129C0")]
		public bool IsValid()
		{
			string empty = string.Empty;
			return this.IsValid(empty);
		}

		// Token: 0x060028A2 RID: 10402
		[Token(Token = "0x60028A2")]
		[Address(Slot = "4")]
		public abstract bool IsValid(ref string message);

		// Token: 0x060028A3 RID: 10403 RVA: 0x0005C7DC File Offset: 0x0005A9DC
		[Token(Token = "0x60028A3")]
		[Address(RVA = "0x1712850", Offset = "0x1711850", VA = "0x181712850")]
		public void Initiate(Transform root)
		{
			IKSolver.UpdateDelegate onPreInitiate = this.OnPreInitiate;
			if (onPreInitiate != 0)
			{
				onPreInitiate();
			}
			int num = 0;
			if (root == num)
			{
				Debug.LogError("Initiating IKSolver with null root Transform.");
			}
			this.root = root;
			this.<initiated>k__BackingField = false;
			string empty = string.Empty;
			if (this.IsValid(empty))
			{
				this.OnInitiate();
				this.StoreDefaultLocalState();
				IKSolver.UpdateDelegate onPostInitiate = this.OnPostInitiate;
				this.<initiated>k__BackingField = true;
				this.firstInitiation = false;
				if (onPostInitiate != 0)
				{
					onPostInitiate();
					return;
				}
			}
			else
			{
				int num2 = 0;
				Warning.Log(empty, root, num2 != 0);
			}
		}

		// Token: 0x060028A4 RID: 10404 RVA: 0x0005C868 File Offset: 0x0005AA68
		[Token(Token = "0x60028A4")]
		[Address(RVA = "0x1712EC0", Offset = "0x1711EC0", VA = "0x181712EC0")]
		public void Update()
		{
			IKSolver.UpdateDelegate onPreUpdate = this.OnPreUpdate;
			if (onPreUpdate != 0)
			{
				onPreUpdate();
			}
			if (this.firstInitiation)
			{
				Transform transform = this.root;
				this.Initiate(transform);
			}
			if (this.<initiated>k__BackingField)
			{
				this.OnUpdate();
				IKSolver.UpdateDelegate onPostUpdate = this.OnPostUpdate;
				if (onPostUpdate != 0)
				{
					onPostUpdate();
					return;
				}
			}
		}

		// Token: 0x060028A5 RID: 10405 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60028A5")]
		[Address(RVA = "0x491550", Offset = "0x490550", VA = "0x180491550", Slot = "5")]
		public virtual Vector3 GetIKPosition()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060028A6 RID: 10406 RVA: 0x0005C8C0 File Offset: 0x0005AAC0
		[Token(Token = "0x60028A6")]
		[Address(RVA = "0x4B2350", Offset = "0x4B1350", VA = "0x1804B2350")]
		public void SetIKPosition(Vector3 position)
		{
			float z = position.z;
			this.IKPosition.z = z;
		}

		// Token: 0x060028A7 RID: 10407 RVA: 0x0005C8E0 File Offset: 0x0005AAE0
		[Token(Token = "0x60028A7")]
		[Address(RVA = "0x5C7D20", Offset = "0x5C6D20", VA = "0x1805C7D20")]
		public float GetIKPositionWeight()
		{
			return this.IKPositionWeight;
		}

		// Token: 0x060028A8 RID: 10408 RVA: 0x0005C8F4 File Offset: 0x0005AAF4
		[Token(Token = "0x60028A8")]
		[Address(RVA = "0x1520030", Offset = "0x151F030", VA = "0x181520030")]
		public void SetIKPositionWeight(float weight)
		{
			int num = 0;
			float num2 = Mathf.Clamp(weight, (float)num, 1f);
			this.IKPositionWeight = num2;
		}

		// Token: 0x060028A9 RID: 10409 RVA: 0x0005C918 File Offset: 0x0005AB18
		[Token(Token = "0x60028A9")]
		[Address(RVA = "0x3701D0", Offset = "0x36F1D0", VA = "0x1803701D0")]
		public Transform GetRoot()
		{
			return this.root;
		}

		// Token: 0x17000256 RID: 598
		// (get) Token: 0x060028AA RID: 10410 RVA: 0x0005C92C File Offset: 0x0005AB2C
		// (set) Token: 0x060028AB RID: 10411 RVA: 0x0005C940 File Offset: 0x0005AB40
		[Token(Token = "0x17000256")]
		public bool initiated
		{
			[Token(Token = "0x60028AA")]
			[Address(RVA = "0x36FF60", Offset = "0x36EF60", VA = "0x18036FF60")]
			get;
			[Token(Token = "0x60028AB")]
			[Address(RVA = "0x68D2A0", Offset = "0x68C2A0", VA = "0x18068D2A0")]
			private set;
		}

		// Token: 0x060028AC RID: 10412
		[Token(Token = "0x60028AC")]
		[Address(Slot = "6")]
		public abstract IKSolver.Point[] GetPoints();

		// Token: 0x060028AD RID: 10413
		[Token(Token = "0x60028AD")]
		[Address(Slot = "7")]
		public abstract IKSolver.Point GetPoint(Transform transform);

		// Token: 0x060028AE RID: 10414
		[Token(Token = "0x60028AE")]
		[Address(Slot = "8")]
		public abstract void FixTransforms();

		// Token: 0x060028AF RID: 10415
		[Token(Token = "0x60028AF")]
		[Address(Slot = "9")]
		public abstract void StoreDefaultLocalState();

		// Token: 0x060028B0 RID: 10416
		[Token(Token = "0x60028B0")]
		[Address(Slot = "10")]
		protected abstract void OnInitiate();

		// Token: 0x060028B1 RID: 10417
		[Token(Token = "0x60028B1")]
		[Address(Slot = "11")]
		protected abstract void OnUpdate();

		// Token: 0x060028B2 RID: 10418 RVA: 0x0005C954 File Offset: 0x0005AB54
		[Token(Token = "0x60028B2")]
		[Address(RVA = "0x1712A20", Offset = "0x1711A20", VA = "0x181712A20")]
		protected void LogWarning(string message)
		{
			Transform transform = this.root;
			Warning.Log(message, transform, true);
		}

		// Token: 0x060028B3 RID: 10419 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60028B3")]
		[Address(RVA = "0x1712650", Offset = "0x1711650", VA = "0x181712650")]
		public static Transform ContainsDuplicateBone(IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060028B4 RID: 10420 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60028B4")]
		[Address(RVA = "0x17127A0", Offset = "0x17117A0", VA = "0x1817127A0")]
		public static bool HierarchyIsValid(IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060028B5 RID: 10421 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60028B5")]
		[Address(RVA = "0x1712A40", Offset = "0x1711A40", VA = "0x181712A40")]
		protected static float PreSolveBones(ref IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060028B6 RID: 10422 RVA: 0x0005C970 File Offset: 0x0005AB70
		[Token(Token = "0x60028B6")]
		[Address(RVA = "0x1712F30", Offset = "0x1711F30", VA = "0x181712F30")]
		protected IKSolver()
		{
		}

		// Token: 0x04003271 RID: 12913
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4003271")]
		[HideInInspector]
		public Vector3 IKPosition;

		// Token: 0x04003272 RID: 12914
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4003272")]
		[Range(0f, 1f)]
		[Tooltip("The positional or the master weight of the solver.")]
		public float IKPositionWeight = 1f;

		// Token: 0x04003274 RID: 12916
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003274")]
		public IKSolver.UpdateDelegate OnPreInitiate;

		// Token: 0x04003275 RID: 12917
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003275")]
		public IKSolver.UpdateDelegate OnPostInitiate;

		// Token: 0x04003276 RID: 12918
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003276")]
		public IKSolver.UpdateDelegate OnPreUpdate;

		// Token: 0x04003277 RID: 12919
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003277")]
		public IKSolver.UpdateDelegate OnPostUpdate;

		// Token: 0x04003278 RID: 12920
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003278")]
		protected bool firstInitiation = true;

		// Token: 0x04003279 RID: 12921
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003279")]
		[HideInInspector]
		[SerializeField]
		protected Transform root;

		// Token: 0x0200047B RID: 1147
		[Token(Token = "0x200047B")]
		[Serializable]
		public class Point
		{
			// Token: 0x060028B7 RID: 10423 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028B7")]
			[Address(RVA = "0x16AD080", Offset = "0x16AC080", VA = "0x1816AD080")]
			public void StoreDefaultLocalState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028B8 RID: 10424 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028B8")]
			[Address(RVA = "0x16ACF90", Offset = "0x16ABF90", VA = "0x1816ACF90")]
			public void FixTransform()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028B9 RID: 10425 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028B9")]
			[Address(RVA = "0x16AD180", Offset = "0x16AC180", VA = "0x1816AD180")]
			public void UpdateSolverPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028BA RID: 10426 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028BA")]
			[Address(RVA = "0x16AD0E0", Offset = "0x16AC0E0", VA = "0x1816AD0E0")]
			public void UpdateSolverLocalPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028BB RID: 10427 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028BB")]
			[Address(RVA = "0x16AD1C0", Offset = "0x16AC1C0", VA = "0x1816AD1C0")]
			public void UpdateSolverState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028BC RID: 10428 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028BC")]
			[Address(RVA = "0x16AD120", Offset = "0x16AC120", VA = "0x1816AD120")]
			public void UpdateSolverLocalState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028BD RID: 10429 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028BD")]
			[Address(RVA = "0x16AC8D0", Offset = "0x16AB8D0", VA = "0x1816AC8D0")]
			public Point()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x0400327A RID: 12922
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x400327A")]
			public Transform transform;

			// Token: 0x0400327B RID: 12923
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x400327B")]
			[Range(0f, 1f)]
			public float weight;

			// Token: 0x0400327C RID: 12924
			[FieldOffset(Offset = "0x1C")]
			[Token(Token = "0x400327C")]
			public Vector3 solverPosition;

			// Token: 0x0400327D RID: 12925
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x400327D")]
			public Quaternion solverRotation;

			// Token: 0x0400327E RID: 12926
			[FieldOffset(Offset = "0x38")]
			[Token(Token = "0x400327E")]
			public Vector3 defaultLocalPosition;

			// Token: 0x0400327F RID: 12927
			[FieldOffset(Offset = "0x44")]
			[Token(Token = "0x400327F")]
			public Quaternion defaultLocalRotation;
		}

		// Token: 0x0200047C RID: 1148
		[Token(Token = "0x200047C")]
		[Serializable]
		public class Bone : IKSolver.Point
		{
			// Token: 0x17000257 RID: 599
			// (get) Token: 0x060028BE RID: 10430 RVA: 0x000020D3 File Offset: 0x000002D3
			// (set) Token: 0x060028BF RID: 10431 RVA: 0x0005C998 File Offset: 0x0005AB98
			[Token(Token = "0x17000257")]
			public RotationLimit rotationLimit
			{
				[Token(Token = "0x60028BE")]
				[Address(RVA = "0x16A24D0", Offset = "0x16A14D0", VA = "0x1816A24D0")]
				get
				{
					throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
				}
				[Token(Token = "0x60028BF")]
				[Address(RVA = "0x16A25D0", Offset = "0x16A15D0", VA = "0x1816A25D0")]
				set
				{
					this._rotationLimit = value;
					int num = 0;
					bool flag = value != num;
					this.isLimited = flag;
				}
			}

			// Token: 0x060028C0 RID: 10432 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C0")]
			[Address(RVA = "0x16A2090", Offset = "0x16A1090", VA = "0x1816A2090")]
			public void Swing(Vector3 swingTarget, float weight = 1f)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C1 RID: 10433 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C1")]
			[Address(RVA = "0x16A1BD0", Offset = "0x16A0BD0", VA = "0x1816A1BD0")]
			public static void SolverSwing(IKSolver.Bone[] bones, int index, Vector3 swingTarget, float weight = 1f)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C2 RID: 10434 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C2")]
			[Address(RVA = "0x16A1EB0", Offset = "0x16A0EB0", VA = "0x1816A1EB0")]
			public void Swing2D(Vector3 swingTarget, float weight = 1f)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C3 RID: 10435 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C3")]
			[Address(RVA = "0x16A1B90", Offset = "0x16A0B90", VA = "0x1816A1B90")]
			public void SetToSolverPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C4 RID: 10436 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C4")]
			[Address(RVA = "0x16A2440", Offset = "0x16A1440", VA = "0x1816A2440")]
			public Bone()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C5 RID: 10437 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C5")]
			[Address(RVA = "0x16A2390", Offset = "0x16A1390", VA = "0x1816A2390")]
			public Bone(Transform transform)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C6 RID: 10438 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C6")]
			[Address(RVA = "0x16A22D0", Offset = "0x16A12D0", VA = "0x1816A22D0")]
			public Bone(Transform transform, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x04003280 RID: 12928
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4003280")]
			public float length;

			// Token: 0x04003281 RID: 12929
			[FieldOffset(Offset = "0x5C")]
			[Token(Token = "0x4003281")]
			public float sqrMag;

			// Token: 0x04003282 RID: 12930
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x4003282")]
			public Vector3 axis;

			// Token: 0x04003283 RID: 12931
			[FieldOffset(Offset = "0x70")]
			[Token(Token = "0x4003283")]
			private RotationLimit _rotationLimit;

			// Token: 0x04003284 RID: 12932
			[FieldOffset(Offset = "0x78")]
			[Token(Token = "0x4003284")]
			private bool isLimited;
		}

		// Token: 0x0200047D RID: 1149
		[Token(Token = "0x200047D")]
		[Serializable]
		public class Node : IKSolver.Point
		{
			// Token: 0x060028C7 RID: 10439 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C7")]
			[Address(RVA = "0x16AC8D0", Offset = "0x16AB8D0", VA = "0x1816AC8D0")]
			public Node()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C8 RID: 10440 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C8")]
			[Address(RVA = "0x16AC880", Offset = "0x16AB880", VA = "0x1816AC880")]
			public Node(Transform transform)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028C9 RID: 10441 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C9")]
			[Address(RVA = "0x16AC910", Offset = "0x16AB910", VA = "0x1816AC910")]
			public Node(Transform transform, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x04003285 RID: 12933
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4003285")]
			public float length;

			// Token: 0x04003286 RID: 12934
			[FieldOffset(Offset = "0x5C")]
			[Token(Token = "0x4003286")]
			public float effectorPositionWeight;

			// Token: 0x04003287 RID: 12935
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x4003287")]
			public float effectorRotationWeight;

			// Token: 0x04003288 RID: 12936
			[FieldOffset(Offset = "0x64")]
			[Token(Token = "0x4003288")]
			public Vector3 offset;
		}

		// Token: 0x0200047E RID: 1150
		[Token(Token = "0x200047E")]
		public sealed class UpdateDelegate : MulticastDelegate
		{
			// Token: 0x060028CA RID: 10442 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CA")]
			[Address(RVA = "0x4932A0", Offset = "0x4922A0", VA = "0x1804932A0")]
			public UpdateDelegate(object @object, IntPtr method)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CB RID: 10443 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CB")]
			[Address(RVA = "0x6D7F40", Offset = "0x6D6F40", VA = "0x1806D7F40", Slot = "13")]
			public void Invoke()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CC RID: 10444 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CC")]
			[Address(RVA = "0x6D7F10", Offset = "0x6D6F10", VA = "0x1806D7F10", Slot = "14")]
			public IAsyncResult BeginInvoke(AsyncCallback callback, object @object)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CD RID: 10445 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CD")]
			[Address(RVA = "0x492FC0", Offset = "0x491FC0", VA = "0x180492FC0", Slot = "15")]
			public void EndInvoke(IAsyncResult result)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x0200047F RID: 1151
		[Token(Token = "0x200047F")]
		public sealed class IterationDelegate : MulticastDelegate
		{
			// Token: 0x060028CE RID: 10446 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CE")]
			[Address(RVA = "0x4932A0", Offset = "0x4922A0", VA = "0x1804932A0")]
			public IterationDelegate(object @object, IntPtr method)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CF RID: 10447 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CF")]
			[Address(RVA = "0x56A4B0", Offset = "0x5694B0", VA = "0x18056A4B0", Slot = "13")]
			public void Invoke(int i)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028D0 RID: 10448 RVA: 0x0005C9C0 File Offset: 0x0005ABC0
			[Token(Token = "0x60028D0")]
			[Address(RVA = "0x16A42F0", Offset = "0x16A32F0", VA = "0x1816A42F0", Slot = "14")]
			public IAsyncResult BeginInvoke(int i, AsyncCallback callback, object @object)
			{
				return typeof(int).TypeHandle;
			}

			// Token: 0x060028D1 RID: 10449 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028D1")]
			[Address(RVA = "0x492FC0", Offset = "0x491FC0", VA = "0x180492FC0", Slot = "15")]
			public void EndInvoke(IAsyncResult result)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}
	}
}
