using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000479 RID: 1145
	[Token(Token = "0x2000479")]
	public class Inertia : OffsetModifier
	{
		// Token: 0x060028D7 RID: 10455 RVA: 0x00059CF0 File Offset: 0x00057EF0
		[Token(Token = "0x60028D7")]
		[Address(RVA = "0x10D2E60", Offset = "0x10D1C60", VA = "0x1810D2E60")]
		public void ResetBodies()
		{
			float time = Time.time;
			Inertia.Body[] array = this.bodies;
			this.lastTime = time;
			int num = 0;
			int length = array.Length;
			if (num < length)
			{
				array[num].Reset();
				num++;
			}
		}

		// Token: 0x060028D8 RID: 10456 RVA: 0x00059D38 File Offset: 0x00057F38
		[Token(Token = "0x60028D8")]
		[Address(RVA = "0x10D2D90", Offset = "0x10D1B90", VA = "0x1810D2D90", Slot = "4")]
		protected override void OnModifyOffset()
		{
			Inertia.Body[] array = this.bodies;
			int num = 0;
			int length = array.Length;
			if (num < length)
			{
				Inertia.Body body = array[num];
				IKSolverFullBodyBiped solver = this.ik.solver;
				float weight = this.weight;
				float deltaTime = base.deltaTime;
				body.Update(solver, weight, deltaTime);
				num++;
			}
			OffsetModifier.OffsetLimits[] array2 = this.limits;
			base.ApplyLimits(array2);
		}

		// Token: 0x060028D9 RID: 10457 RVA: 0x00059DA4 File Offset: 0x00057FA4
		[Token(Token = "0x60028D9")]
		[Address(RVA = "0x8CD260", Offset = "0x8CC060", VA = "0x1808CD260")]
		public Inertia()
		{
		}

		// Token: 0x04003214 RID: 12820
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003214")]
		[Tooltip("The array of Bodies")]
		public Inertia.Body[] bodies;

		// Token: 0x04003215 RID: 12821
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003215")]
		[Tooltip("The array of OffsetLimits")]
		public OffsetModifier.OffsetLimits[] limits;

		// Token: 0x0200047A RID: 1146
		[Token(Token = "0x200047A")]
		[Serializable]
		public class Body
		{
			// Token: 0x060028DA RID: 10458 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028DA")]
			[Address(RVA = "0x14E64C0", Offset = "0x14E52C0", VA = "0x1814E64C0")]
			public void Reset()
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028DB RID: 10459 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028DB")]
			[Address(RVA = "0x14E65A0", Offset = "0x14E53A0", VA = "0x1814E65A0")]
			public void Update(IKSolverFullBodyBiped solver, float weight, float deltaTime)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028DC RID: 10460 RVA: 0x00059DB8 File Offset: 0x00057FB8
			[Token(Token = "0x60028DC")]
			[Address(RVA = "0x14E6B00", Offset = "0x14E5900", VA = "0x1814E6B00")]
			public Body()
			{
			}

			// Token: 0x04003216 RID: 12822
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x4003216")]
			[Tooltip("The Transform to follow, can be any bone of the character")]
			public Transform transform;

			// Token: 0x04003217 RID: 12823
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x4003217")]
			[Tooltip("Linking the body to effectors. One Body can be used to offset more than one effector")]
			public Inertia.Body.EffectorLink[] effectorLinks;

			// Token: 0x04003218 RID: 12824
			[FieldOffset(Offset = "0x20")]
			[Token(Token = "0x4003218")]
			[Tooltip("The speed to follow the Transform")]
			public float speed = 10f;

			// Token: 0x04003219 RID: 12825
			[FieldOffset(Offset = "0x24")]
			[Token(Token = "0x4003219")]
			[Tooltip("The acceleration, smaller values means lazyer following")]
			public float acceleration = 3f;

			// Token: 0x0400321A RID: 12826
			[FieldOffset(Offset = "0x28")]
			[Token(Token = "0x400321A")]
			[Tooltip("Matching target velocity")]
			[Range(0f, 1f)]
			public float matchVelocity;

			// Token: 0x0400321B RID: 12827
			[FieldOffset(Offset = "0x2C")]
			[Token(Token = "0x400321B")]
			[Tooltip("gravity applied to the Body")]
			public float gravity;

			// Token: 0x0400321C RID: 12828
			[FieldOffset(Offset = "0x30")]
			[Token(Token = "0x400321C")]
			private Vector3 delta;

			// Token: 0x0400321D RID: 12829
			[FieldOffset(Offset = "0x3C")]
			[Token(Token = "0x400321D")]
			private Vector3 lazyPoint;

			// Token: 0x0400321E RID: 12830
			[FieldOffset(Offset = "0x48")]
			[Token(Token = "0x400321E")]
			private Vector3 direction;

			// Token: 0x0400321F RID: 12831
			[FieldOffset(Offset = "0x54")]
			[Token(Token = "0x400321F")]
			private Vector3 lastPosition;

			// Token: 0x04003220 RID: 12832
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x4003220")]
			private bool firstUpdate = true;

			// Token: 0x0200047B RID: 1147
			[Token(Token = "0x200047B")]
			[Serializable]
			public class EffectorLink
			{
				// Token: 0x060028DD RID: 10461 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028DD")]
				[Address(RVA = "0x3D8B20", Offset = "0x3D7920", VA = "0x1803D8B20")]
				public EffectorLink()
				{
				}

				// Token: 0x04003221 RID: 12833
				[FieldOffset(Offset = "0x10")]
				[Token(Token = "0x4003221")]
				[Tooltip("Type of the FBBIK effector to use")]
				public FullBodyBipedEffector effector;

				// Token: 0x04003222 RID: 12834
				[FieldOffset(Offset = "0x14")]
				[Token(Token = "0x4003222")]
				[Tooltip("Weight of using this effector")]
				public float weight;
			}
		}
	}
}
