using System;
using System.Runtime.CompilerServices;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000473 RID: 1139
	[Token(Token = "0x2000473")]
	public class HitReactionVRIK : OffsetModifierVRIK
	{
		// Token: 0x060028B8 RID: 10424 RVA: 0x000599CC File Offset: 0x00057BCC
		[Token(Token = "0x60028B8")]
		[Address(RVA = "0x117E490", Offset = "0x117D290", VA = "0x18117E490", Slot = "4")]
		protected override void OnModifyOffset()
		{
			HitReactionVRIK.PositionOffset[] array = this.positionOffsets;
			int num = 0;
			int length = array.Length;
			if (num < length)
			{
				HitReactionVRIK.PositionOffset positionOffset = array[num];
				float weight = this.weight;
				AnimationCurve[] array2 = this.offsetCurves;
				VRIK ik = this.ik;
				positionOffset.Apply(ik, array2, weight);
				num++;
			}
			HitReactionVRIK.RotationOffset[] array3 = this.rotationOffsets;
			int length2 = array3.Length;
			if (num < length2)
			{
				HitReactionVRIK.RotationOffset rotationOffset = array3[num];
				float weight2 = this.weight;
				AnimationCurve[] array4 = this.offsetCurves;
				VRIK ik2 = this.ik;
				rotationOffset.Apply(ik2, array4, weight2);
				num++;
			}
		}

		// Token: 0x060028B9 RID: 10425 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60028B9")]
		[Address(RVA = "0x117E1F0", Offset = "0x117CFF0", VA = "0x18117E1F0")]
		public void Hit(Collider collider, Vector3 force, Vector3 point)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x060028BA RID: 10426 RVA: 0x00059A6C File Offset: 0x00057C6C
		[Token(Token = "0x60028BA")]
		[Address(RVA = "0x8CD260", Offset = "0x8CC060", VA = "0x1808CD260")]
		public HitReactionVRIK()
		{
		}

		// Token: 0x040031F9 RID: 12793
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x40031F9")]
		public AnimationCurve[] offsetCurves;

		// Token: 0x040031FA RID: 12794
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x40031FA")]
		[Tooltip("Hit points for the FBBIK effectors")]
		public HitReactionVRIK.PositionOffset[] positionOffsets;

		// Token: 0x040031FB RID: 12795
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x40031FB")]
		[Tooltip(" Hit points for bones without an effector, such as the head")]
		public HitReactionVRIK.RotationOffset[] rotationOffsets;

		// Token: 0x02000474 RID: 1140
		[Token(Token = "0x2000474")]
		[Serializable]
		public abstract class Offset
		{
			// Token: 0x17000296 RID: 662
			// (get) Token: 0x060028BB RID: 10427 RVA: 0x00059A80 File Offset: 0x00057C80
			// (set) Token: 0x060028BC RID: 10428 RVA: 0x00059A94 File Offset: 0x00057C94
			[Token(Token = "0x17000296")]
			private protected float crossFader
			{
				[Token(Token = "0x60028BB")]
				[Address(RVA = "0x5B0660", Offset = "0x5AF460", VA = "0x1805B0660")]
				protected get;
				[Token(Token = "0x60028BC")]
				[Address(RVA = "0x5B0700", Offset = "0x5AF500", VA = "0x1805B0700")]
				private set;
			}

			// Token: 0x17000297 RID: 663
			// (get) Token: 0x060028BD RID: 10429 RVA: 0x00059AA8 File Offset: 0x00057CA8
			// (set) Token: 0x060028BE RID: 10430 RVA: 0x00059ABC File Offset: 0x00057CBC
			[Token(Token = "0x17000297")]
			private protected float timer
			{
				[Token(Token = "0x60028BD")]
				[Address(RVA = "0x5F9910", Offset = "0x5F8710", VA = "0x1805F9910")]
				protected get;
				[Token(Token = "0x60028BE")]
				[Address(RVA = "0x5F9930", Offset = "0x5F8730", VA = "0x1805F9930")]
				private set;
			}

			// Token: 0x17000298 RID: 664
			// (get) Token: 0x060028BF RID: 10431 RVA: 0x000020D3 File Offset: 0x000002D3
			// (set) Token: 0x060028C0 RID: 10432 RVA: 0x00059AD0 File Offset: 0x00057CD0
			[Token(Token = "0x17000298")]
			private protected Vector3 force
			{
				[Token(Token = "0x60028BF")]
				[Address(RVA = "0x126EB40", Offset = "0x126D940", VA = "0x18126EB40")]
				[CompilerGenerated]
				protected get
				{
					throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
				}
				[Token(Token = "0x60028C0")]
				[Address(RVA = "0x126EC30", Offset = "0x126DA30", VA = "0x18126EC30")]
				[CompilerGenerated]
				private set
				{
					float z = value.z;
					this.<force>k__BackingField.z = z;
				}
			}

			// Token: 0x17000299 RID: 665
			// (get) Token: 0x060028C1 RID: 10433 RVA: 0x000020D3 File Offset: 0x000002D3
			// (set) Token: 0x060028C2 RID: 10434 RVA: 0x00059AF0 File Offset: 0x00057CF0
			[Token(Token = "0x17000299")]
			private protected Vector3 point
			{
				[Token(Token = "0x60028C1")]
				[Address(RVA = "0x38DAF0", Offset = "0x38C8F0", VA = "0x18038DAF0")]
				[CompilerGenerated]
				protected get
				{
					throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
				}
				[Token(Token = "0x60028C2")]
				[Address(RVA = "0x38DB70", Offset = "0x38C970", VA = "0x18038DB70")]
				[CompilerGenerated]
				private set
				{
					float z = value.z;
					this.<point>k__BackingField.z = z;
				}
			}

			// Token: 0x060028C3 RID: 10435 RVA: 0x00059B10 File Offset: 0x00057D10
			[Token(Token = "0x60028C3")]
			[Address(RVA = "0x14F18B0", Offset = "0x14F06B0", VA = "0x1814F18B0")]
			public void Hit(Vector3 force, AnimationCurve[] curves, Vector3 point)
			{
				int num = 0;
				float num2 = this.GetLength(curves);
				this.length = num2;
				if (num < (int)num2)
				{
					int num3 = 0;
					this.<crossFader>k__BackingField = (float)num3;
					if (this.crossFadeTime > (float)num)
					{
					}
					int num4 = 0;
					this.crossFadeSpeed = (float)num4;
					this.CrossFadeStart();
					float z = force.z;
					this.<force>k__BackingField.z = z;
					float z2 = point.z;
					this.<point>k__BackingField.z = z2;
					this.<timer>k__BackingField = (float)num3;
				}
				Debug.LogError("Hit Point WeightCurve length is zero.");
			}

			// Token: 0x060028C4 RID: 10436 RVA: 0x00059B90 File Offset: 0x00057D90
			[Token(Token = "0x60028C4")]
			[Address(RVA = "0x14F17C0", Offset = "0x14F05C0", VA = "0x1814F17C0")]
			public void Apply(VRIK ik, AnimationCurve[] curves, float weight)
			{
				float time = Time.time;
				float time2 = Time.time;
				float num = this.length;
				this.lastTime = time2;
				float num2 = this.<timer>k__BackingField;
				if (num2 < num)
				{
					int num3 = 0;
					int num4 = 0;
					float num5 = Mathf.Clamp(num2, (float)num3, num);
					this.<timer>k__BackingField = num5;
					float num6 = this.crossFadeSpeed;
					if (num6 <= (float)num4)
					{
					}
					int num7 = 0;
					float num8 = Mathf.Clamp(num6, (float)num7, 1f);
					this.<crossFader>k__BackingField = num8;
					this.OnApply(ik, curves, weight);
				}
			}

			// Token: 0x060028C5 RID: 10437
			[Token(Token = "0x60028C5")]
			[Address(Slot = "4")]
			protected abstract float GetLength(AnimationCurve[] curves);

			// Token: 0x060028C6 RID: 10438
			[Token(Token = "0x60028C6")]
			[Address(Slot = "5")]
			protected abstract void CrossFadeStart();

			// Token: 0x060028C7 RID: 10439
			[Token(Token = "0x60028C7")]
			[Address(Slot = "6")]
			protected abstract void OnApply(VRIK ik, AnimationCurve[] curves, float weight);

			// Token: 0x060028C8 RID: 10440 RVA: 0x00059C18 File Offset: 0x00057E18
			[Token(Token = "0x60028C8")]
			[Address(RVA = "0x14EA8B0", Offset = "0x14E96B0", VA = "0x1814EA8B0")]
			protected Offset()
			{
			}

			// Token: 0x040031FC RID: 12796
			[FieldOffset(Offset = "0x10")]
			[Token(Token = "0x40031FC")]
			[Tooltip("Just for visual clarity, not used at all")]
			public string name;

			// Token: 0x040031FD RID: 12797
			[FieldOffset(Offset = "0x18")]
			[Token(Token = "0x40031FD")]
			[Tooltip("Linking this hit point to a collider")]
			public Collider collider;

			// Token: 0x040031FE RID: 12798
			[FieldOffset(Offset = "0x20")]
			[Token(Token = "0x40031FE")]
			[SerializeField]
			[Tooltip("Only used if this hit point gets hit when already processing another hit")]
			private float crossFadeTime = 0.1f;

			// Token: 0x04003203 RID: 12803
			[FieldOffset(Offset = "0x44")]
			[Token(Token = "0x4003203")]
			private float length;

			// Token: 0x04003204 RID: 12804
			[FieldOffset(Offset = "0x48")]
			[Token(Token = "0x4003204")]
			private float crossFadeSpeed;

			// Token: 0x04003205 RID: 12805
			[FieldOffset(Offset = "0x4C")]
			[Token(Token = "0x4003205")]
			private float lastTime;
		}

		// Token: 0x02000475 RID: 1141
		[Token(Token = "0x2000475")]
		[Serializable]
		public class PositionOffset : HitReactionVRIK.Offset
		{
			// Token: 0x060028C9 RID: 10441 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028C9")]
			[Address(RVA = "0x14F28D0", Offset = "0x14F16D0", VA = "0x1814F28D0", Slot = "4")]
			protected override float GetLength(AnimationCurve[] curves)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CA RID: 10442 RVA: 0x00059C38 File Offset: 0x00057E38
			[Token(Token = "0x60028CA")]
			[Address(RVA = "0x14F2870", Offset = "0x14F1670", VA = "0x1814F2870", Slot = "5")]
			protected override void CrossFadeStart()
			{
				HitReactionVRIK.PositionOffset.PositionOffsetLink[] array = this.offsetLinks;
				int num = 0;
				int length = array.Length;
				if (num < length)
				{
					array[num].CrossFadeStart();
					num++;
				}
			}

			// Token: 0x060028CB RID: 10443 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028CB")]
			[Address(RVA = "0x14F2AF0", Offset = "0x14F18F0", VA = "0x1814F2AF0", Slot = "6")]
			protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028CC RID: 10444 RVA: 0x00059C70 File Offset: 0x00057E70
			[Token(Token = "0x60028CC")]
			[Address(RVA = "0x14F2D70", Offset = "0x14F1B70", VA = "0x1814F2D70")]
			public PositionOffset()
			{
				this.crossFadeTime = 0.1f;
				base..ctor();
			}

			// Token: 0x04003206 RID: 12806
			[FieldOffset(Offset = "0x50")]
			[Token(Token = "0x4003206")]
			[Tooltip("Offset magnitude in the direction of the hit force")]
			public int forceDirCurveIndex;

			// Token: 0x04003207 RID: 12807
			[FieldOffset(Offset = "0x54")]
			[Token(Token = "0x4003207")]
			[Tooltip("Offset magnitude in the direction of character.up")]
			public int upDirCurveIndex = (int)((ulong)1L);

			// Token: 0x04003208 RID: 12808
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x4003208")]
			[Tooltip("Linking this offset to the VRIK position offsets")]
			public HitReactionVRIK.PositionOffset.PositionOffsetLink[] offsetLinks;

			// Token: 0x02000476 RID: 1142
			[Token(Token = "0x2000476")]
			[Serializable]
			public class PositionOffsetLink
			{
				// Token: 0x060028CD RID: 10445 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028CD")]
				[Address(RVA = "0x132D2E0", Offset = "0x132C0E0", VA = "0x18132D2E0")]
				public void Apply(VRIK ik, Vector3 offset, float crossFader)
				{
				}

				// Token: 0x060028CE RID: 10446 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028CE")]
				[Address(RVA = "0x132C870", Offset = "0x132B670", VA = "0x18132C870")]
				public void CrossFadeStart()
				{
				}

				// Token: 0x060028CF RID: 10447 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028CF")]
				[Address(RVA = "0x3D8B20", Offset = "0x3D7920", VA = "0x1803D8B20")]
				public PositionOffsetLink()
				{
				}

				// Token: 0x04003209 RID: 12809
				[FieldOffset(Offset = "0x10")]
				[Token(Token = "0x4003209")]
				[Tooltip("The FBBIK effector type")]
				public IKSolverVR.PositionOffset positionOffset;

				// Token: 0x0400320A RID: 12810
				[FieldOffset(Offset = "0x14")]
				[Token(Token = "0x400320A")]
				[Tooltip("The weight of this effector (could also be negative)")]
				public float weight;

				// Token: 0x0400320B RID: 12811
				[FieldOffset(Offset = "0x18")]
				[Token(Token = "0x400320B")]
				private Vector3 lastValue;

				// Token: 0x0400320C RID: 12812
				[FieldOffset(Offset = "0x24")]
				[Token(Token = "0x400320C")]
				private Vector3 current;
			}
		}

		// Token: 0x02000477 RID: 1143
		[Token(Token = "0x2000477")]
		[Serializable]
		public class RotationOffset : HitReactionVRIK.Offset
		{
			// Token: 0x060028D0 RID: 10448 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028D0")]
			[Address(RVA = "0x14F2F10", Offset = "0x14F1D10", VA = "0x1814F2F10", Slot = "4")]
			protected override float GetLength(AnimationCurve[] curves)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028D1 RID: 10449 RVA: 0x00059C98 File Offset: 0x00057E98
			[Token(Token = "0x60028D1")]
			[Address(RVA = "0x14F2EB0", Offset = "0x14F1CB0", VA = "0x1814F2EB0", Slot = "5")]
			protected override void CrossFadeStart()
			{
				HitReactionVRIK.RotationOffset.RotationOffsetLink[] array = this.offsetLinks;
				int num = 0;
				int length = array.Length;
				if (num < length)
				{
					array[num].CrossFadeStart();
					num++;
				}
			}

			// Token: 0x060028D2 RID: 10450 RVA: 0x000020D3 File Offset: 0x000002D3
			[Token(Token = "0x60028D2")]
			[Address(RVA = "0x14F3030", Offset = "0x14F1E30", VA = "0x1814F3030", Slot = "6")]
			protected override void OnApply(VRIK ik, AnimationCurve[] curves, float weight)
			{
				throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
			}

			// Token: 0x060028D3 RID: 10451 RVA: 0x00059CD0 File Offset: 0x00057ED0
			[Token(Token = "0x60028D3")]
			[Address(RVA = "0x14EA8B0", Offset = "0x14E96B0", VA = "0x1814EA8B0")]
			public RotationOffset()
			{
				this.crossFadeTime = 0.1f;
				base..ctor();
			}

			// Token: 0x0400320D RID: 12813
			[FieldOffset(Offset = "0x50")]
			[Token(Token = "0x400320D")]
			[Tooltip("The angle to rotate the bone around it's rigidbody's world center of mass")]
			public int curveIndex;

			// Token: 0x0400320E RID: 12814
			[FieldOffset(Offset = "0x58")]
			[Token(Token = "0x400320E")]
			[Tooltip("Linking this hit point to bone(s)")]
			public HitReactionVRIK.RotationOffset.RotationOffsetLink[] offsetLinks;

			// Token: 0x0400320F RID: 12815
			[FieldOffset(Offset = "0x60")]
			[Token(Token = "0x400320F")]
			private Rigidbody rigidbody;

			// Token: 0x02000478 RID: 1144
			[Token(Token = "0x2000478")]
			[Serializable]
			public class RotationOffsetLink
			{
				// Token: 0x060028D4 RID: 10452 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028D4")]
				[Address(RVA = "0x132EA20", Offset = "0x132D820", VA = "0x18132EA20")]
				public void Apply(VRIK ik, Quaternion offset, float crossFader)
				{
				}

				// Token: 0x060028D5 RID: 10453 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028D5")]
				[Address(RVA = "0x132EB10", Offset = "0x132D910", VA = "0x18132EB10")]
				public void CrossFadeStart()
				{
				}

				// Token: 0x060028D6 RID: 10454 RVA: 0x0003883F File Offset: 0x00036A3F
				[Token(Token = "0x60028D6")]
				[Address(RVA = "0x132EB20", Offset = "0x132D920", VA = "0x18132EB20")]
				public RotationOffsetLink()
				{
				}

				// Token: 0x04003210 RID: 12816
				[FieldOffset(Offset = "0x10")]
				[Token(Token = "0x4003210")]
				[Tooltip("Reference to the bone that this hit point rotates")]
				public IKSolverVR.RotationOffset rotationOffset;

				// Token: 0x04003211 RID: 12817
				[FieldOffset(Offset = "0x14")]
				[Token(Token = "0x4003211")]
				[Range(0f, 1f)]
				[Tooltip("Weight of rotating the bone")]
				public float weight;

				// Token: 0x04003212 RID: 12818
				[FieldOffset(Offset = "0x18")]
				[Token(Token = "0x4003212")]
				private Quaternion lastValue;

				// Token: 0x04003213 RID: 12819
				[FieldOffset(Offset = "0x28")]
				[Token(Token = "0x4003213")]
				private Quaternion current;
			}
		}
	}
}
