using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000422 RID: 1058
	[Token(Token = "0x2000422")]
	[Serializable]
	public abstract class IKSolver
	{
		// Token: 0x060025D8 RID: 9688 RVA: 0x00055464 File Offset: 0x00053664
		[Token(Token = "0x60025D8")]
		[Address(RVA = "0x1186660", Offset = "0x1185460", VA = "0x181186660")]
		public bool IsValid()
		{
			string empty = string.Empty;
			return this.IsValid(empty);
		}

		// Token: 0x060025D9 RID: 9689
		[Token(Token = "0x60025D9")]
		[Address(Slot = "4")]
		public abstract bool IsValid(ref string message);

		// Token: 0x060025DA RID: 9690 RVA: 0x00055480 File Offset: 0x00053680
		[Token(Token = "0x60025DA")]
		[Address(RVA = "0x11864F0", Offset = "0x11852F0", VA = "0x1811864F0")]
		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: 0x060025DB RID: 9691 RVA: 0x0005550C File Offset: 0x0005370C
		[Token(Token = "0x60025DB")]
		[Address(RVA = "0x1186B90", Offset = "0x1185990", VA = "0x181186B90")]
		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: 0x060025DC RID: 9692 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025DC")]
		[Address(RVA = "0x42E030", Offset = "0x42CE30", VA = "0x18042E030", Slot = "5")]
		public virtual Vector3 GetIKPosition()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025DD RID: 9693 RVA: 0x00055564 File Offset: 0x00053764
		[Token(Token = "0x60025DD")]
		[Address(RVA = "0x5FD260", Offset = "0x5FC060", VA = "0x1805FD260")]
		public void SetIKPosition(Vector3 position)
		{
			float z = position.z;
			this.IKPosition.z = z;
		}

		// Token: 0x060025DE RID: 9694 RVA: 0x00055584 File Offset: 0x00053784
		[Token(Token = "0x60025DE")]
		[Address(RVA = "0x5B5B10", Offset = "0x5B4910", VA = "0x1805B5B10")]
		public float GetIKPositionWeight()
		{
			return this.IKPositionWeight;
		}

		// Token: 0x060025DF RID: 9695 RVA: 0x00055598 File Offset: 0x00053798
		[Token(Token = "0x60025DF")]
		[Address(RVA = "0x1186B60", Offset = "0x1185960", VA = "0x181186B60")]
		public void SetIKPositionWeight(float weight)
		{
			int num = 0;
			float num2 = Mathf.Clamp(weight, (float)num, 1f);
			this.IKPositionWeight = num2;
		}

		// Token: 0x060025E0 RID: 9696 RVA: 0x000555BC File Offset: 0x000537BC
		[Token(Token = "0x60025E0")]
		[Address(RVA = "0x517700", Offset = "0x516500", VA = "0x180517700")]
		public Transform GetRoot()
		{
			return this.root;
		}

		// Token: 0x17000231 RID: 561
		// (get) Token: 0x060025E1 RID: 9697 RVA: 0x000555D0 File Offset: 0x000537D0
		// (set) Token: 0x060025E2 RID: 9698 RVA: 0x000555E4 File Offset: 0x000537E4
		[Token(Token = "0x17000231")]
		public bool initiated
		{
			[Token(Token = "0x60025E1")]
			[Address(RVA = "0x51C310", Offset = "0x51B110", VA = "0x18051C310")]
			get;
			[Token(Token = "0x60025E2")]
			[Address(RVA = "0x691DE0", Offset = "0x690BE0", VA = "0x180691DE0")]
			private set;
		}

		// Token: 0x060025E3 RID: 9699
		[Token(Token = "0x60025E3")]
		[Address(Slot = "6")]
		public abstract IKSolver.Point[] GetPoints();

		// Token: 0x060025E4 RID: 9700
		[Token(Token = "0x60025E4")]
		[Address(Slot = "7")]
		public abstract IKSolver.Point GetPoint(Transform transform);

		// Token: 0x060025E5 RID: 9701
		[Token(Token = "0x60025E5")]
		[Address(Slot = "8")]
		public abstract void FixTransforms();

		// Token: 0x060025E6 RID: 9702
		[Token(Token = "0x60025E6")]
		[Address(Slot = "9")]
		public abstract void StoreDefaultLocalState();

		// Token: 0x060025E7 RID: 9703
		[Token(Token = "0x60025E7")]
		[Address(Slot = "10")]
		protected abstract void OnInitiate();

		// Token: 0x060025E8 RID: 9704
		[Token(Token = "0x60025E8")]
		[Address(Slot = "11")]
		protected abstract void OnUpdate();

		// Token: 0x060025E9 RID: 9705 RVA: 0x000555F8 File Offset: 0x000537F8
		[Token(Token = "0x60025E9")]
		[Address(RVA = "0x11866C0", Offset = "0x11854C0", VA = "0x1811866C0")]
		protected void LogWarning(string message)
		{
			Transform transform = this.root;
			Warning.Log(message, transform, true);
		}

		// Token: 0x060025EA RID: 9706 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025EA")]
		[Address(RVA = "0x11862F0", Offset = "0x11850F0", VA = "0x1811862F0")]
		public static Transform ContainsDuplicateBone(IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025EB RID: 9707 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025EB")]
		[Address(RVA = "0x1186440", Offset = "0x1185240", VA = "0x181186440")]
		public static bool HierarchyIsValid(IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025EC RID: 9708 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025EC")]
		[Address(RVA = "0x11866E0", Offset = "0x11854E0", VA = "0x1811866E0")]
		protected static float PreSolveBones(ref IKSolver.Bone[] bones)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060025ED RID: 9709 RVA: 0x00055614 File Offset: 0x00053814
		[Token(Token = "0x60025ED")]
		[Address(RVA = "0x1186C00", Offset = "0x1185A00", VA = "0x181186C00")]
		protected IKSolver()
		{
		}

		// Token: 0x04002F87 RID: 12167
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4002F87")]
		[HideInInspector]
		public Vector3 IKPosition;

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

		// Token: 0x04002F8A RID: 12170
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002F8A")]
		public IKSolver.UpdateDelegate OnPreInitiate;

		// Token: 0x04002F8B RID: 12171
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002F8B")]
		public IKSolver.UpdateDelegate OnPostInitiate;

		// Token: 0x04002F8C RID: 12172
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4002F8C")]
		public IKSolver.UpdateDelegate OnPreUpdate;

		// Token: 0x04002F8D RID: 12173
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002F8D")]
		public IKSolver.UpdateDelegate OnPostUpdate;

		// Token: 0x04002F8E RID: 12174
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4002F8E")]
		protected bool firstInitiation = true;

		// Token: 0x04002F8F RID: 12175
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4002F8F")]
		[SerializeField]
		[HideInInspector]
		protected Transform root;

		// Token: 0x02000423 RID: 1059
		[Token(Token = "0x2000423")]
		[Serializable]
		public class Point
		{
			// Token: 0x060025EE RID: 9710 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025EE")]
			[Address(RVA = "0x14F26D0", Offset = "0x14F14D0", VA = "0x1814F26D0")]
			public void StoreDefaultLocalState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025EF RID: 9711 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025EF")]
			[Address(RVA = "0x14F25E0", Offset = "0x14F13E0", VA = "0x1814F25E0")]
			public void FixTransform()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F0 RID: 9712 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F0")]
			[Address(RVA = "0x14F27D0", Offset = "0x14F15D0", VA = "0x1814F27D0")]
			public void UpdateSolverPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F1 RID: 9713 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F1")]
			[Address(RVA = "0x14F2730", Offset = "0x14F1530", VA = "0x1814F2730")]
			public void UpdateSolverLocalPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F2 RID: 9714 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F2")]
			[Address(RVA = "0x14F2810", Offset = "0x14F1610", VA = "0x1814F2810")]
			public void UpdateSolverState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F3 RID: 9715 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F3")]
			[Address(RVA = "0x14F2770", Offset = "0x14F1570", VA = "0x1814F2770")]
			public void UpdateSolverLocalState()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F4 RID: 9716 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F4")]
			[Address(RVA = "0x14F1720", Offset = "0x14F0520", VA = "0x1814F1720")]
			public Point()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x04002F90 RID: 12176
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4002F90")]
			public Transform transform;

			// Token: 0x04002F91 RID: 12177
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x4002F91")]
			[Range(0f, 1f)]
			public float weight;

			// Token: 0x04002F92 RID: 12178
			[FieldOffset(Offset = "0x1C")]
			[Token(Token = "0x4002F92")]
			public Vector3 solverPosition;

			// Token: 0x04002F93 RID: 12179
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x4002F93")]
			public Quaternion solverRotation;

			// Token: 0x04002F94 RID: 12180
			[FieldOffset(Offset = "0x38")]
			[Token(Token = "0x4002F94")]
			public Vector3 defaultLocalPosition;

			// Token: 0x04002F95 RID: 12181
			[FieldOffset(Offset = "0x44")]
			[Token(Token = "0x4002F95")]
			public Quaternion defaultLocalRotation;
		}

		// Token: 0x02000424 RID: 1060
		[Token(Token = "0x2000424")]
		[Serializable]
		public class Bone : IKSolver.Point
		{
			// Token: 0x17000232 RID: 562
			// (get) Token: 0x060025F5 RID: 9717 RVA: 0x000020D3 File Offset: 0x000002D3
			// (set) Token: 0x060025F6 RID: 9718 RVA: 0x0005563C File Offset: 0x0005383C
			[Token(Token = "0x17000232")]
			public RotationLimit rotationLimit
			{
				[Token(Token = "0x60025F5")]
				[Address(RVA = "0x14E8E70", Offset = "0x14E7C70", VA = "0x1814E8E70")]
				get
				{
					throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
				}
				[Token(Token = "0x60025F6")]
				[Address(RVA = "0x14E8F70", Offset = "0x14E7D70", VA = "0x1814E8F70")]
				set
				{
					this._rotationLimit = value;
					int num = 0;
					bool flag = value != num;
					this.isLimited = flag;
				}
			}

			// Token: 0x060025F7 RID: 9719 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F7")]
			[Address(RVA = "0x14E8A30", Offset = "0x14E7830", VA = "0x1814E8A30")]
			public void Swing(Vector3 swingTarget, float weight = 1f)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025F8 RID: 9720 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F8")]
			[Address(RVA = "0x14E8570", Offset = "0x14E7370", VA = "0x1814E8570")]
			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: 0x060025F9 RID: 9721 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025F9")]
			[Address(RVA = "0x14E8850", Offset = "0x14E7650", VA = "0x1814E8850")]
			public void Swing2D(Vector3 swingTarget, float weight = 1f)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025FA RID: 9722 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FA")]
			[Address(RVA = "0x14E8530", Offset = "0x14E7330", VA = "0x1814E8530")]
			public void SetToSolverPosition()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025FB RID: 9723 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FB")]
			[Address(RVA = "0x14E8DE0", Offset = "0x14E7BE0", VA = "0x1814E8DE0")]
			public Bone()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025FC RID: 9724 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FC")]
			[Address(RVA = "0x14E8D30", Offset = "0x14E7B30", VA = "0x1814E8D30")]
			public Bone(Transform transform)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025FD RID: 9725 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FD")]
			[Address(RVA = "0x14E8C70", Offset = "0x14E7A70", VA = "0x1814E8C70")]
			public Bone(Transform transform, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x04002F96 RID: 12182
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4002F96")]
			public float length;

			// Token: 0x04002F97 RID: 12183
			[FieldOffset(Offset = "0x5C")]
			[Token(Token = "0x4002F97")]
			public float sqrMag;

			// Token: 0x04002F98 RID: 12184
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x4002F98")]
			public Vector3 axis;

			// Token: 0x04002F99 RID: 12185
			[FieldOffset(Offset = "0x70")]
			[Token(Token = "0x4002F99")]
			private RotationLimit _rotationLimit;

			// Token: 0x04002F9A RID: 12186
			[FieldOffset(Offset = "0x78")]
			[Token(Token = "0x4002F9A")]
			private bool isLimited;
		}

		// Token: 0x02000425 RID: 1061
		[Token(Token = "0x2000425")]
		[Serializable]
		public class Node : IKSolver.Point
		{
			// Token: 0x060025FE RID: 9726 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FE")]
			[Address(RVA = "0x14F1720", Offset = "0x14F0520", VA = "0x1814F1720")]
			public Node()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060025FF RID: 9727 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60025FF")]
			[Address(RVA = "0x14F16D0", Offset = "0x14F04D0", VA = "0x1814F16D0")]
			public Node(Transform transform)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002600 RID: 9728 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002600")]
			[Address(RVA = "0x14F1760", Offset = "0x14F0560", VA = "0x1814F1760")]
			public Node(Transform transform, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x04002F9B RID: 12187
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4002F9B")]
			public float length;

			// Token: 0x04002F9C RID: 12188
			[FieldOffset(Offset = "0x5C")]
			[Token(Token = "0x4002F9C")]
			public float effectorPositionWeight;

			// Token: 0x04002F9D RID: 12189
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x4002F9D")]
			public float effectorRotationWeight;

			// Token: 0x04002F9E RID: 12190
			[FieldOffset(Offset = "0x64")]
			[Token(Token = "0x4002F9E")]
			public Vector3 offset;
		}

		// Token: 0x02000426 RID: 1062
		[Token(Token = "0x2000426")]
		public sealed class UpdateDelegate : MulticastDelegate
		{
			// Token: 0x06002601 RID: 9729 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002601")]
			[Address(RVA = "0x44EA10", Offset = "0x44D810", VA = "0x18044EA10")]
			public UpdateDelegate(object @object, IntPtr method)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002602 RID: 9730 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002602")]
			[Address(RVA = "0x122AE30", Offset = "0x1229C30", VA = "0x18122AE30", Slot = "12")]
			public void Invoke()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002603 RID: 9731 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002603")]
			[Address(RVA = "0x5FA1E0", Offset = "0x5F8FE0", VA = "0x1805FA1E0", Slot = "13")]
			public IAsyncResult BeginInvoke(AsyncCallback callback, object @object)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002604 RID: 9732 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002604")]
			[Address(RVA = "0x44E730", Offset = "0x44D530", VA = "0x18044E730", Slot = "14")]
			public void EndInvoke(IAsyncResult result)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}

		// Token: 0x02000427 RID: 1063
		[Token(Token = "0x2000427")]
		public sealed class IterationDelegate : MulticastDelegate
		{
			// Token: 0x06002605 RID: 9733 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002605")]
			[Address(RVA = "0x44EA10", Offset = "0x44D810", VA = "0x18044EA10")]
			public IterationDelegate(object @object, IntPtr method)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002606 RID: 9734 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002606")]
			[Address(RVA = "0x55BA30", Offset = "0x55A830", VA = "0x18055BA30", Slot = "12")]
			public void Invoke(int i)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x06002607 RID: 9735 RVA: 0x00055664 File Offset: 0x00053864
			[Token(Token = "0x6002607")]
			[Address(RVA = "0x14EB4A0", Offset = "0x14EA2A0", VA = "0x1814EB4A0", Slot = "13")]
			public IAsyncResult BeginInvoke(int i, AsyncCallback callback, object @object)
			{
				return typeof(int).TypeHandle;
			}

			// Token: 0x06002608 RID: 9736 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x6002608")]
			[Address(RVA = "0x44E730", Offset = "0x44D530", VA = "0x18044E730", Slot = "14")]
			public void EndInvoke(IAsyncResult result)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}
		}
	}
}
