using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x020003F1 RID: 1009
	[Token(Token = "0x20003F1")]
	[Serializable]
	public class BipedIKSolvers
	{
		// Token: 0x1700020B RID: 523
		// (get) Token: 0x06002438 RID: 9272 RVA: 0x00052A98 File Offset: 0x00050C98
		[Token(Token = "0x1700020B")]
		public IKSolverLimb[] limbs
		{
			[Token(Token = "0x6002438")]
			[Address(RVA = "0x8D5090", Offset = "0x8D3E90", VA = "0x1808D5090")]
			get
			{
				IKSolverLimb[] limbs;
				IKSolverLimb[] array;
				IKSolverLimb iksolverLimb4;
				for (;;)
				{
					limbs = this._limbs;
					if (limbs != 0 && limbs.Length == 4)
					{
						return limbs;
					}
					array = new IKSolverLimb[4];
					IKSolverLimb iksolverLimb = this.leftFoot;
					if (iksolverLimb == 0 || array != 0)
					{
						array[0] = iksolverLimb;
						IKSolverLimb iksolverLimb2 = this.rightFoot;
						if (iksolverLimb2 == 0 || array != 0)
						{
							array[1] = iksolverLimb2;
							IKSolverLimb iksolverLimb3 = this.leftHand;
							if (iksolverLimb3 == 0 || array != 0)
							{
								array[2] = iksolverLimb3;
								iksolverLimb4 = this.rightHand;
								if (iksolverLimb4 == 0 || array != 0)
								{
									break;
								}
							}
						}
					}
				}
				array[3] = iksolverLimb4;
				this._limbs = array;
				return limbs;
			}
		}

		// Token: 0x1700020C RID: 524
		// (get) Token: 0x06002439 RID: 9273 RVA: 0x00052B34 File Offset: 0x00050D34
		[Token(Token = "0x1700020C")]
		public IKSolver[] ikSolvers
		{
			[Token(Token = "0x6002439")]
			[Address(RVA = "0x8D4D80", Offset = "0x8D3B80", VA = "0x1808D4D80")]
			get
			{
				IKSolver[] ikSolvers;
				IKSolver[] array;
				IKSolverAim iksolverAim;
				for (;;)
				{
					ikSolvers = this._ikSolvers;
					if (ikSolvers != 0 && ikSolvers.Length == 7)
					{
						return ikSolvers;
					}
					array = new IKSolver[7];
					IKSolverLimb iksolverLimb = this.leftFoot;
					if (iksolverLimb == 0 || array != 0)
					{
						array[0] = iksolverLimb;
						IKSolverLimb iksolverLimb2 = this.rightFoot;
						if (iksolverLimb2 == 0 || array != 0)
						{
							array[1] = iksolverLimb2;
							IKSolverLimb iksolverLimb3 = this.leftHand;
							if (iksolverLimb3 == 0 || array != 0)
							{
								array[2] = iksolverLimb3;
								IKSolverLimb iksolverLimb4 = this.rightHand;
								if (iksolverLimb4 == 0 || array != 0)
								{
									array[3] = iksolverLimb4;
									IKSolverFABRIK iksolverFABRIK = this.spine;
									if (iksolverFABRIK == 0 || array != 0)
									{
										array[4] = iksolverFABRIK;
										IKSolverLookAt iksolverLookAt = this.lookAt;
										if (iksolverLookAt == 0 || array != 0)
										{
											array[5] = iksolverLookAt;
											iksolverAim = this.aim;
											if (iksolverAim == 0 || array != 0)
											{
												break;
											}
										}
									}
								}
							}
						}
					}
				}
				array[6] = iksolverAim;
				this._ikSolvers = array;
				return ikSolvers;
			}
		}

		// Token: 0x0600243A RID: 9274 RVA: 0x00052C28 File Offset: 0x00050E28
		[Token(Token = "0x600243A")]
		[Address(RVA = "0x8D4A20", Offset = "0x8D3820", VA = "0x1808D4A20")]
		public void AssignReferences(BipedReferences references)
		{
			IKSolverLimb iksolverLimb = this.leftHand;
			Transform root = references.root;
			int num = 0;
			Transform transform = references.leftHand;
			Transform leftForearm = references.leftForearm;
			Transform leftUpperArm = references.leftUpperArm;
			bool flag = iksolverLimb.SetChain(leftUpperArm, leftForearm, transform, root);
			IKSolverLimb iksolverLimb2 = this.rightHand;
			Transform root2 = references.root;
			Transform transform2 = references.rightHand;
			Transform rightForearm = references.rightForearm;
			Transform rightUpperArm = references.rightUpperArm;
			bool flag2 = iksolverLimb2.SetChain(rightUpperArm, rightForearm, transform2, root2);
			IKSolverLimb iksolverLimb3 = this.leftFoot;
			Transform root3 = references.root;
			Transform transform3 = references.leftFoot;
			Transform leftCalf = references.leftCalf;
			Transform leftThigh = references.leftThigh;
			bool flag3 = iksolverLimb3.SetChain(leftThigh, leftCalf, transform3, root3);
			IKSolverLimb iksolverLimb4 = this.rightFoot;
			Transform root4 = references.root;
			Transform transform4 = references.rightFoot;
			Transform rightCalf = references.rightCalf;
			Transform rightThigh = references.rightThigh;
			bool flag4 = iksolverLimb4.SetChain(rightThigh, rightCalf, transform4, root4);
			IKSolverFABRIK iksolverFABRIK = this.spine;
			Transform root5 = references.root;
			Transform[] array = references.spine;
			bool flag5 = iksolverFABRIK.SetChain(array, root5);
			IKSolverLookAt iksolverLookAt = this.lookAt;
			Transform root6 = references.root;
			Transform[] eyes = references.eyes;
			Transform head = references.head;
			Transform[] array2 = references.spine;
			bool flag6 = iksolverLookAt.SetChain(array2, head, eyes, root6);
			IKSolverAim iksolverAim = this.aim;
			Transform root7 = references.root;
			Transform[] array3 = references.spine;
			bool flag7 = iksolverAim.SetChain(array3, root7);
			this.leftFoot.goal = (AvatarIKGoal)num;
			this.rightFoot.goal = (AvatarIKGoal)((ulong)1L);
			this.leftHand.goal = (AvatarIKGoal)((ulong)2L);
			this.rightHand.goal = (AvatarIKGoal)((ulong)3L);
		}

		// Token: 0x0600243B RID: 9275 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600243B")]
		[Address(RVA = "0x8D4BC0", Offset = "0x8D39C0", VA = "0x1808D4BC0")]
		public BipedIKSolvers()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04002DF3 RID: 11763
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4002DF3")]
		public IKSolverLimb leftFoot;

		// Token: 0x04002DF4 RID: 11764
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002DF4")]
		public IKSolverLimb rightFoot;

		// Token: 0x04002DF5 RID: 11765
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002DF5")]
		public IKSolverLimb leftHand;

		// Token: 0x04002DF6 RID: 11766
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002DF6")]
		public IKSolverLimb rightHand;

		// Token: 0x04002DF7 RID: 11767
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002DF7")]
		public IKSolverFABRIK spine;

		// Token: 0x04002DF8 RID: 11768
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4002DF8")]
		public IKSolverLookAt lookAt;

		// Token: 0x04002DF9 RID: 11769
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002DF9")]
		public IKSolverAim aim;

		// Token: 0x04002DFA RID: 11770
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4002DFA")]
		public Constraints pelvis;

		// Token: 0x04002DFB RID: 11771
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4002DFB")]
		private IKSolverLimb[] _limbs;

		// Token: 0x04002DFC RID: 11772
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4002DFC")]
		private IKSolver[] _ikSolvers;
	}
}
