using System;
using System.Xml.Schema;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000448 RID: 1096
	[Token(Token = "0x2000448")]
	[AddComponentMenu("Scripts/RootMotion.FinalIK/IK/Biped IK")]
	[HelpURL("http://www.root-motion.com/finalikdox/html/page2.html")]
	public class BipedIK : SolverManager
	{
		// Token: 0x060026E8 RID: 9960 RVA: 0x00059648 File Offset: 0x00057848
		[Token(Token = "0x60026E8")]
		[Address(RVA = "0x7A15A0", Offset = "0x7A05A0", VA = "0x1807A15A0")]
		[ContextMenu("User Manual")]
		private void OpenUserManual()
		{
			Application.OpenURL("http://www.root-motion.com/finalikdox/html/page2.html");
		}

		// Token: 0x060026E9 RID: 9961 RVA: 0x00059660 File Offset: 0x00057860
		[Token(Token = "0x60026E9")]
		[Address(RVA = "0x7A1560", Offset = "0x7A0560", VA = "0x1807A1560")]
		[ContextMenu("Scrpt Reference")]
		private void OpenScriptReference()
		{
			Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_biped_i_k.html");
		}

		// Token: 0x060026EA RID: 9962 RVA: 0x00059678 File Offset: 0x00057878
		[Token(Token = "0x60026EA")]
		[Address(RVA = "0x7A1AC0", Offset = "0x7A0AC0", VA = "0x1807A1AC0")]
		[ContextMenu("Support Group")]
		private void SupportGroup()
		{
			Application.OpenURL("https://groups.google.com/forum/#!forum/final-ik");
		}

		// Token: 0x060026EB RID: 9963 RVA: 0x00059690 File Offset: 0x00057890
		[Token(Token = "0x60026EB")]
		[Address(RVA = "0x7A0E80", Offset = "0x79FE80", VA = "0x1807A0E80")]
		[ContextMenu("Asset Store Thread")]
		private void ASThread()
		{
			Application.OpenURL("http://forum.unity3d.com/threads/final-ik-full-body-ik-aim-look-at-fabrik-ccd-ik-1-0-released.222685/");
		}

		// Token: 0x060026EC RID: 9964 RVA: 0x000596A8 File Offset: 0x000578A8
		[Token(Token = "0x60026EC")]
		[Address(RVA = "0x7A1000", Offset = "0x7A0000", VA = "0x1807A1000")]
		public float GetIKPositionWeight(AvatarIKGoal goal)
		{
			if (goal != AvatarIKGoal.LeftFoot)
			{
				if (goal != AvatarIKGoal.LeftFoot)
				{
					if (goal != AvatarIKGoal.LeftFoot)
					{
						BipedIKSolvers bipedIKSolvers = this.solvers;
					}
					BipedIKSolvers bipedIKSolvers2 = this.solvers;
				}
				BipedIKSolvers bipedIKSolvers3 = this.solvers;
			}
			return this.solvers.leftFoot.IKPositionWeight;
		}

		// Token: 0x060026ED RID: 9965 RVA: 0x000596EC File Offset: 0x000578EC
		[Token(Token = "0x60026ED")]
		[Address(RVA = "0x7A1110", Offset = "0x7A0110", VA = "0x1807A1110")]
		public float GetIKRotationWeight(AvatarIKGoal goal)
		{
			if (goal != AvatarIKGoal.LeftFoot)
			{
				if (goal != AvatarIKGoal.LeftFoot)
				{
					if (goal != AvatarIKGoal.LeftFoot)
					{
						BipedIKSolvers bipedIKSolvers = this.solvers;
					}
					BipedIKSolvers bipedIKSolvers2 = this.solvers;
				}
				BipedIKSolvers bipedIKSolvers3 = this.solvers;
			}
			return this.solvers.leftFoot.IKRotationWeight;
		}

		// Token: 0x060026EE RID: 9966 RVA: 0x00059730 File Offset: 0x00057930
		[Token(Token = "0x60026EE")]
		[Address(RVA = "0x7A15E0", Offset = "0x7A05E0", VA = "0x1807A15E0")]
		public void SetIKPositionWeight(AvatarIKGoal goal, float weight)
		{
			if (goal != AvatarIKGoal.LeftFoot)
			{
				if (goal != AvatarIKGoal.LeftFoot)
				{
					if (goal != AvatarIKGoal.LeftFoot)
					{
						BipedIKSolvers bipedIKSolvers = this.solvers;
					}
					BipedIKSolvers bipedIKSolvers2 = this.solvers;
				}
				BipedIKSolvers bipedIKSolvers3 = this.solvers;
			}
			this.solvers.leftFoot.SetIKPositionWeight(weight);
		}

		// Token: 0x060026EF RID: 9967 RVA: 0x00059778 File Offset: 0x00057978
		[Token(Token = "0x60026EF")]
		[Address(RVA = "0x7A16D0", Offset = "0x7A06D0", VA = "0x1807A16D0")]
		public void SetIKRotationWeight(AvatarIKGoal goal, float weight)
		{
			if (goal != AvatarIKGoal.LeftFoot)
			{
				if (goal != AvatarIKGoal.LeftFoot)
				{
					if (goal != AvatarIKGoal.LeftFoot)
					{
						BipedIKSolvers bipedIKSolvers = this.solvers;
					}
					BipedIKSolvers bipedIKSolvers2 = this.solvers;
				}
				BipedIKSolvers bipedIKSolvers3 = this.solvers;
			}
			this.solvers.leftFoot.SetIKRotationWeight(weight);
		}

		// Token: 0x060026F0 RID: 9968 RVA: 0x000597C0 File Offset: 0x000579C0
		[Token(Token = "0x60026F0")]
		[Address(RVA = "0x7A1650", Offset = "0x7A0650", VA = "0x1807A1650")]
		public void SetIKPosition(AvatarIKGoal goal, Vector3 IKPosition)
		{
			if (goal != AvatarIKGoal.LeftFoot)
			{
				if (goal != AvatarIKGoal.LeftFoot)
				{
					if (goal != AvatarIKGoal.LeftFoot)
					{
						BipedIKSolvers bipedIKSolvers = this.solvers;
					}
					BipedIKSolvers bipedIKSolvers2 = this.solvers;
				}
				BipedIKSolvers bipedIKSolvers3 = this.solvers;
			}
			IKSolverLimb leftFoot = this.solvers.leftFoot;
			float z = IKPosition.z;
			leftFoot.IKPosition.z = z;
		}

		// Token: 0x060026F1 RID: 9969 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026F1")]
		[Address(RVA = "0x7A1740", Offset = "0x7A0740", VA = "0x1807A1740")]
		public void SetIKRotation(AvatarIKGoal goal, Quaternion IKRotation)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026F2 RID: 9970 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026F2")]
		[Address(RVA = "0x7A1070", Offset = "0x7A0070", VA = "0x1807A1070")]
		public Vector3 GetIKPosition(AvatarIKGoal goal)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026F3 RID: 9971 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026F3")]
		[Address(RVA = "0x7A1180", Offset = "0x7A0180", VA = "0x1807A1180")]
		public Quaternion GetIKRotation(AvatarIKGoal goal)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026F4 RID: 9972 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026F4")]
		[Address(RVA = "0x7A17E0", Offset = "0x7A07E0", VA = "0x1807A17E0")]
		public void SetLookAtWeight(float weight, float bodyWeight, float headWeight, float eyesWeight, float clampWeight, float clampWeightHead, float clampWeightEyes)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026F5 RID: 9973 RVA: 0x00059818 File Offset: 0x00057A18
		[Token(Token = "0x60026F5")]
		[Address(RVA = "0x7A17B0", Offset = "0x7A07B0", VA = "0x1807A17B0")]
		public void SetLookAtPosition(Vector3 lookAtPosition)
		{
			IKSolverLookAt lookAt = this.solvers.lookAt;
			float z = lookAtPosition.z;
			lookAt.IKPosition.z = z;
		}

		// Token: 0x060026F6 RID: 9974 RVA: 0x0005984C File Offset: 0x00057A4C
		[Token(Token = "0x60026F6")]
		[Address(RVA = "0x7A1820", Offset = "0x7A0820", VA = "0x1807A1820")]
		public void SetSpinePosition(Vector3 spinePosition)
		{
			IKSolverFABRIK spine = this.solvers.spine;
			float z = spinePosition.z;
			spine.IKPosition.z = z;
		}

		// Token: 0x060026F7 RID: 9975 RVA: 0x00059880 File Offset: 0x00057A80
		[Token(Token = "0x60026F7")]
		[Address(RVA = "0x7A1850", Offset = "0x7A0850", VA = "0x1807A1850")]
		public void SetSpineWeight(float weight)
		{
			this.solvers.spine.SetIKPositionWeight(weight);
		}

		// Token: 0x060026F8 RID: 9976 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026F8")]
		[Address(RVA = "0x7A0F90", Offset = "0x79FF90", VA = "0x1807A0F90")]
		public IKSolverLimb GetGoalIK(AvatarIKGoal goal)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026F9 RID: 9977 RVA: 0x000598A4 File Offset: 0x00057AA4
		[Token(Token = "0x60026F9")]
		[Address(RVA = "0x634150", Offset = "0x633150", VA = "0x180634150")]
		public void InitiateBipedIK()
		{
			XmlSchemaType xmlType = base.XmlType;
		}

		// Token: 0x060026FA RID: 9978 RVA: 0x000598B8 File Offset: 0x00057AB8
		[Token(Token = "0x60026FA")]
		[Address(RVA = "0x32E680", Offset = "0x32D680", VA = "0x18032E680")]
		public void UpdateBipedIK()
		{
			XmlSchemaType xmlType = base.XmlType;
		}

		// Token: 0x060026FB RID: 9979 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60026FB")]
		[Address(RVA = "0x7A1880", Offset = "0x7A0880", VA = "0x1807A1880")]
		public void SetToDefaults()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060026FC RID: 9980 RVA: 0x000598CC File Offset: 0x00057ACC
		[Token(Token = "0x60026FC")]
		[Address(RVA = "0x7A0EC0", Offset = "0x79FEC0", VA = "0x1807A0EC0", Slot = "6")]
		protected override void FixTransforms()
		{
			this.solvers.lookAt.FixTransforms();
			BipedIKSolvers bipedIKSolvers = this.solvers;
			int num = 0;
			IKSolverLimb[] limbs = bipedIKSolvers.limbs;
			if (num < limbs.Length)
			{
				this.solvers.limbs[num].FixTransforms();
				BipedIKSolvers bipedIKSolvers2 = this.solvers;
				num++;
			}
		}

		// Token: 0x060026FD RID: 9981 RVA: 0x0005992C File Offset: 0x00057B2C
		[Token(Token = "0x60026FD")]
		[Address(RVA = "0x7A11F0", Offset = "0x7A01F0", VA = "0x1807A11F0", Slot = "4")]
		protected override void InitiateSolver()
		{
			string text;
			if (!BipedReferences.SetupError(this.references, text))
			{
				BipedIKSolvers bipedIKSolvers = this.solvers;
				BipedReferences bipedReferences = this.references;
				IKSolverLimb leftHand = bipedIKSolvers.leftHand;
				Transform root = bipedReferences.root;
				int num = 0;
				Transform leftHand2 = bipedReferences.leftHand;
				Transform leftForearm = bipedReferences.leftForearm;
				Transform leftUpperArm = bipedReferences.leftUpperArm;
				bool flag = leftHand.SetChain(leftUpperArm, leftForearm, leftHand2, root);
				IKSolverLimb rightHand = bipedIKSolvers.rightHand;
				Transform root2 = bipedReferences.root;
				Transform rightHand2 = bipedReferences.rightHand;
				Transform rightForearm = bipedReferences.rightForearm;
				Transform rightUpperArm = bipedReferences.rightUpperArm;
				bool flag2 = rightHand.SetChain(rightUpperArm, rightForearm, rightHand2, root2);
				IKSolverLimb leftFoot = bipedIKSolvers.leftFoot;
				Transform root3 = bipedReferences.root;
				Transform leftFoot2 = bipedReferences.leftFoot;
				Transform leftCalf = bipedReferences.leftCalf;
				Transform leftThigh = bipedReferences.leftThigh;
				bool flag3 = leftFoot.SetChain(leftThigh, leftCalf, leftFoot2, root3);
				IKSolverLimb rightFoot = bipedIKSolvers.rightFoot;
				Transform root4 = bipedReferences.root;
				Transform rightFoot2 = bipedReferences.rightFoot;
				Transform rightCalf = bipedReferences.rightCalf;
				Transform rightThigh = bipedReferences.rightThigh;
				bool flag4 = rightFoot.SetChain(rightThigh, rightCalf, rightFoot2, root4);
				IKSolverFABRIK spine = bipedIKSolvers.spine;
				Transform root5 = bipedReferences.root;
				Transform[] spine2 = bipedReferences.spine;
				bool flag5 = spine.SetChain(spine2, root5);
				IKSolverLookAt lookAt = bipedIKSolvers.lookAt;
				Transform root6 = bipedReferences.root;
				Transform[] eyes = bipedReferences.eyes;
				Transform head = bipedReferences.head;
				Transform[] spine3 = bipedReferences.spine;
				bool flag6 = lookAt.SetChain(spine3, head, eyes, root6);
				IKSolverAim aim = bipedIKSolvers.aim;
				Transform root7 = bipedReferences.root;
				Transform[] spine4 = bipedReferences.spine;
				bool flag7 = aim.SetChain(spine4, root7);
				bipedIKSolvers.leftFoot.goal = (AvatarIKGoal)num;
				bipedIKSolvers.rightFoot.goal = (AvatarIKGoal)((ulong)1L);
				bipedIKSolvers.leftHand.goal = (AvatarIKGoal)((ulong)2L);
				bipedIKSolvers.rightHand.goal = (AvatarIKGoal)((ulong)3L);
				BipedIKSolvers bipedIKSolvers2 = this.solvers;
				IKSolverFABRIK spine5 = bipedIKSolvers2.spine;
				if (spine5.bones.Length > 1)
				{
					Transform transform = base.transform;
					spine5.Initiate(transform);
					BipedIKSolvers bipedIKSolvers3 = this.solvers;
				}
				IKSolverLookAt lookAt2 = bipedIKSolvers2.lookAt;
				Transform transform2 = base.transform;
				lookAt2.Initiate(transform2);
				IKSolverAim aim2 = this.solvers.aim;
				Transform transform3 = base.transform;
				aim2.Initiate(transform3);
				IKSolverLimb[] limbs = this.solvers.limbs;
				int length = limbs.Length;
				if (num < length)
				{
					IKSolverLimb iksolverLimb = limbs[num];
					Transform transform4 = base.transform;
					iksolverLimb.Initiate(transform4);
					num++;
				}
				BipedIKSolvers bipedIKSolvers4 = this.solvers;
				BipedReferences bipedReferences2 = this.references;
				Constraints pelvis = bipedIKSolvers4.pelvis;
				Transform pelvis2 = bipedReferences2.pelvis;
				pelvis.Initiate(pelvis2);
				return;
			}
			Transform root8 = this.references.root;
			int num2 = 0;
			Warning.Log(text, root8, num2 != 0);
			throw new NullReferenceException();
		}

		// Token: 0x060026FE RID: 9982 RVA: 0x00059BF4 File Offset: 0x00057DF4
		[Token(Token = "0x60026FE")]
		[Address(RVA = "0x7A1B00", Offset = "0x7A0B00", VA = "0x1807A1B00", Slot = "5")]
		protected override void UpdateSolver()
		{
			int num;
			IKSolverFABRIK spine;
			do
			{
				BipedIKSolvers bipedIKSolvers = this.solvers;
				num = 0;
				IKSolverLimb[] limbs = bipedIKSolvers.limbs;
				BipedIKSolvers bipedIKSolvers2 = this.solvers;
				if (num < limbs.Length)
				{
					bipedIKSolvers2.limbs[num].MaintainBend();
					this.solvers.limbs[num].MaintainRotation();
					BipedIKSolvers bipedIKSolvers3 = this.solvers;
					num++;
				}
				bipedIKSolvers2.pelvis.Update();
				spine = this.solvers.spine;
			}
			while (spine.bones.Length <= 1);
			spine.Update();
			this.solvers.aim.Update();
			this.solvers.lookAt.Update();
			IKSolverLimb[] limbs2 = this.solvers.limbs;
			if (num < limbs2.Length)
			{
				this.solvers.limbs[num].Update();
				BipedIKSolvers bipedIKSolvers4 = this.solvers;
				num++;
				while (bipedIKSolvers4 != 0)
				{
				}
			}
		}

		// Token: 0x060026FF RID: 9983 RVA: 0x00059CE8 File Offset: 0x00057EE8
		[Token(Token = "0x60026FF")]
		[Address(RVA = "0x509620", Offset = "0x508620", VA = "0x180509620")]
		public void LogWarning(string message)
		{
			Transform transform = base.transform;
			int num = 0;
			Warning.Log(message, transform, num != 0);
		}

		// Token: 0x06002700 RID: 9984 RVA: 0x00059D08 File Offset: 0x00057F08
		[Token(Token = "0x6002700")]
		[Address(RVA = "0x7A1D20", Offset = "0x7A0D20", VA = "0x1807A1D20")]
		public BipedIK()
		{
			BipedReferences bipedReferences = new BipedReferences();
			this.references = bipedReferences;
			BipedIKSolvers bipedIKSolvers = new BipedIKSolvers();
			this.solvers = bipedIKSolvers;
			base..ctor();
		}

		// Token: 0x040030DB RID: 12507
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40030DB")]
		public BipedReferences references;

		// Token: 0x040030DC RID: 12508
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40030DC")]
		public BipedIKSolvers solvers;
	}
}
