using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x0200034B RID: 843
[Token(Token = "0x200034B")]
[AddComponentMenu("Dynamic Bone/Dynamic Bone")]
public class DynamicBone : MonoBehaviour
{
	// Token: 0x060020D2 RID: 8402 RVA: 0x0004E20C File Offset: 0x0004C40C
	[Token(Token = "0x60020D2")]
	[Address(RVA = "0xA5BB10", Offset = "0xA5A910", VA = "0x180A5BB10")]
	private void Start()
	{
		this.SetupParticles();
	}

	// Token: 0x060020D3 RID: 8403 RVA: 0x0004E220 File Offset: 0x0004C420
	[Token(Token = "0x60020D3")]
	[Address(RVA = "0xA5A8F0", Offset = "0xA596F0", VA = "0x180A5A8F0")]
	private void FixedUpdate()
	{
		if (this.m_UpdateMode == DynamicBone.UpdateMode.AnimatePhysics)
		{
			float weight = this.m_Weight;
			int num = 0;
			if (weight > (float)num && (!this.m_DistantDisable || !this.m_DistantDisabled))
			{
				this.InitTransforms();
			}
		}
	}

	// Token: 0x060020D4 RID: 8404 RVA: 0x0004E25C File Offset: 0x0004C45C
	[Token(Token = "0x60020D4")]
	[Address(RVA = "0xA5CFC0", Offset = "0xA5BDC0", VA = "0x180A5CFC0")]
	private void Update()
	{
		if (this.m_UpdateMode != DynamicBone.UpdateMode.AnimatePhysics)
		{
			float weight = this.m_Weight;
			int num = 0;
			if (weight > (float)num && (!this.m_DistantDisable || !this.m_DistantDisabled))
			{
				this.InitTransforms();
			}
		}
	}

	// Token: 0x060020D5 RID: 8405 RVA: 0x0004E298 File Offset: 0x0004C498
	[Token(Token = "0x60020D5")]
	[Address(RVA = "0xA5AAA0", Offset = "0xA598A0", VA = "0x180A5AAA0")]
	private void LateUpdate()
	{
		if (this.m_DistantDisable)
		{
			this.CheckDistance();
		}
		float num = this.m_Weight;
		int num2 = 0;
		if (num > (float)num2 && (!this.m_DistantDisable || !this.m_DistantDisabled))
		{
			num = Time.deltaTime;
			this.UpdateDynamicBones(num);
			return;
		}
	}

	// Token: 0x060020D6 RID: 8406 RVA: 0x0004E2E4 File Offset: 0x0004C4E4
	[Token(Token = "0x60020D6")]
	[Address(RVA = "0xA5AEE0", Offset = "0xA59CE0", VA = "0x180A5AEE0")]
	private void PreUpdate()
	{
		float weight = this.m_Weight;
		int num = 0;
		if (weight > (float)num && (!this.m_DistantDisable || !this.m_DistantDisabled))
		{
			this.InitTransforms();
			return;
		}
	}

	// Token: 0x060020D7 RID: 8407 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020D7")]
	[Address(RVA = "0xA5A700", Offset = "0xA59500", VA = "0x180A5A700")]
	private void CheckDistance()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020D8 RID: 8408 RVA: 0x0004E318 File Offset: 0x0004C518
	[Token(Token = "0x60020D8")]
	[Address(RVA = "0xA5AE20", Offset = "0xA59C20", VA = "0x180A5AE20")]
	private void OnEnable()
	{
		this.ResetParticlesPosition();
	}

	// Token: 0x060020D9 RID: 8409 RVA: 0x0004E32C File Offset: 0x0004C52C
	[Token(Token = "0x60020D9")]
	[Address(RVA = "0xA5ABE0", Offset = "0xA599E0", VA = "0x180A5ABE0")]
	private void OnDisable()
	{
		this.InitTransforms();
	}

	// Token: 0x060020DA RID: 8410 RVA: 0x0004E340 File Offset: 0x0004C540
	[Token(Token = "0x60020DA")]
	[Address(RVA = "0xA5AE30", Offset = "0xA59C30", VA = "0x180A5AE30")]
	private void OnValidate()
	{
		float updateRate = this.m_UpdateRate;
		int num = 0;
		float num2 = Mathf.Max(updateRate, (float)num);
		this.m_UpdateRate = num2;
		float num3 = Mathf.Clamp01(this.m_Damping);
		this.m_Damping = num3;
		float num4 = Mathf.Clamp01(this.m_Elasticity);
		this.m_Elasticity = num4;
		float num5 = Mathf.Clamp01(this.m_Stiffness);
		this.m_Stiffness = num5;
		float num6 = Mathf.Clamp01(this.m_Inert);
		this.m_Inert = num6;
		float radius = this.m_Radius;
		int num7 = 0;
		float num8 = Mathf.Max(radius, (float)num7);
		this.m_Radius = num8;
		if (Application.isEditor && Application.isPlaying)
		{
			this.InitTransforms();
			this.SetupParticles();
			return;
		}
	}

	// Token: 0x060020DB RID: 8411 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020DB")]
	[Address(RVA = "0xA5ABF0", Offset = "0xA599F0", VA = "0x180A5ABF0")]
	private void OnDrawGizmosSelected()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020DC RID: 8412 RVA: 0x0004E3F8 File Offset: 0x0004C5F8
	[Token(Token = "0x60020DC")]
	[Address(RVA = "0xA5B0F0", Offset = "0xA59EF0", VA = "0x180A5B0F0")]
	public void SetWeight(float w)
	{
		this.InitTransforms();
		this.m_Weight = w;
	}

	// Token: 0x060020DD RID: 8413 RVA: 0x0004E420 File Offset: 0x0004C620
	[Token(Token = "0x60020DD")]
	[Address(RVA = "0xA5A930", Offset = "0xA59730", VA = "0x180A5A930")]
	public float GetWeight()
	{
		return this.m_Weight;
	}

	// Token: 0x060020DE RID: 8414 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020DE")]
	[Address(RVA = "0xA5BB20", Offset = "0xA5A920", VA = "0x180A5BB20")]
	private void UpdateDynamicBones(float t)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020DF RID: 8415 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020DF")]
	[Address(RVA = "0xA5B160", Offset = "0xA59F60", VA = "0x180A5B160")]
	private void SetupParticles()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E0 RID: 8416 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E0")]
	[Address(RVA = "0xA59C00", Offset = "0xA58A00", VA = "0x180A59C00")]
	private void AppendParticles(Transform b, int parentIndex, float boneLength)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E1 RID: 8417 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E1")]
	[Address(RVA = "0xA5BD70", Offset = "0xA5AB70", VA = "0x180A5BD70")]
	public void UpdateParameters()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E2 RID: 8418 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E2")]
	[Address(RVA = "0xA5A940", Offset = "0xA59740", VA = "0x180A5A940")]
	private void InitTransforms()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E3 RID: 8419 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E3")]
	[Address(RVA = "0xA5AF10", Offset = "0xA59D10", VA = "0x180A5AF10")]
	private void ResetParticlesPosition()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E4 RID: 8420 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E4")]
	[Address(RVA = "0xA5C0F0", Offset = "0xA5AEF0", VA = "0x180A5C0F0")]
	private void UpdateParticles1()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E5 RID: 8421 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E5")]
	[Address(RVA = "0xA5C550", Offset = "0xA5B350", VA = "0x180A5C550")]
	private void UpdateParticles2()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E6 RID: 8422 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E6")]
	[Address(RVA = "0xA5B300", Offset = "0xA5A100", VA = "0x180A5B300")]
	private void SkipUpdateParticles()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E7 RID: 8423 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E7")]
	[Address(RVA = "0xA5AB00", Offset = "0xA59900", VA = "0x180A5AB00")]
	private static Vector3 MirrorVector(Vector3 v, Vector3 axis)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E8 RID: 8424 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60020E8")]
	[Address(RVA = "0xA5A3A0", Offset = "0xA591A0", VA = "0x180A5A3A0")]
	private void ApplyParticlesToTransforms()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060020E9 RID: 8425 RVA: 0x0004E434 File Offset: 0x0004C634
	[Token(Token = "0x60020E9")]
	[Address(RVA = "0xA5D000", Offset = "0xA5BE00", VA = "0x180A5D000")]
	public DynamicBone()
	{
		float z = Vector3.zero.z;
		this.m_EndOffset.z = z;
		float z2 = Vector3.zero.z;
		this.m_Gravity.z = z2;
		float z3 = Vector3.zero.z;
		this.m_Force.z = z3;
		this.m_DistanceToObject = 20f;
		float z4 = Vector3.zero.z;
		this.m_LocalGravity.z = z4;
		float z5 = Vector3.zero.z;
		this.m_ObjectMove.z = z5;
		float z6 = Vector3.zero.z;
		this.m_ObjectPrevPosition.z = z6;
		this.m_ObjectScale = 1f;
		this.m_Weight = 1f;
		List<DynamicBone.Particle> list = new List();
		this.m_Particles = list;
		base..ctor();
	}

	// Token: 0x04002A27 RID: 10791
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002A27")]
	public Transform m_Root;

	// Token: 0x04002A28 RID: 10792
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002A28")]
	public float m_UpdateRate = 60f;

	// Token: 0x04002A29 RID: 10793
	[FieldOffset(Offset = "0x24")]
	[Token(Token = "0x4002A29")]
	public DynamicBone.UpdateMode m_UpdateMode;

	// Token: 0x04002A2A RID: 10794
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002A2A")]
	[Range(0f, 1f)]
	public float m_Damping = 0.1f;

	// Token: 0x04002A2B RID: 10795
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4002A2B")]
	public AnimationCurve m_DampingDistrib;

	// Token: 0x04002A2C RID: 10796
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002A2C")]
	[Range(0f, 1f)]
	public float m_Elasticity = 0.1f;

	// Token: 0x04002A2D RID: 10797
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4002A2D")]
	public AnimationCurve m_ElasticityDistrib;

	// Token: 0x04002A2E RID: 10798
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002A2E")]
	[Range(0f, 1f)]
	public float m_Stiffness = 0.1f;

	// Token: 0x04002A2F RID: 10799
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4002A2F")]
	public AnimationCurve m_StiffnessDistrib;

	// Token: 0x04002A30 RID: 10800
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002A30")]
	[Range(0f, 1f)]
	public float m_Inert;

	// Token: 0x04002A31 RID: 10801
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002A31")]
	public AnimationCurve m_InertDistrib;

	// Token: 0x04002A32 RID: 10802
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002A32")]
	public float m_Radius;

	// Token: 0x04002A33 RID: 10803
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002A33")]
	public AnimationCurve m_RadiusDistrib;

	// Token: 0x04002A34 RID: 10804
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002A34")]
	public float m_EndLength;

	// Token: 0x04002A35 RID: 10805
	[FieldOffset(Offset = "0x7C")]
	[Token(Token = "0x4002A35")]
	public Vector3 m_EndOffset;

	// Token: 0x04002A36 RID: 10806
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002A36")]
	public Vector3 m_Gravity;

	// Token: 0x04002A37 RID: 10807
	[FieldOffset(Offset = "0x94")]
	[Token(Token = "0x4002A37")]
	public Vector3 m_Force;

	// Token: 0x04002A38 RID: 10808
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4002A38")]
	public List<DynamicBoneColliderBase> m_Colliders;

	// Token: 0x04002A39 RID: 10809
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4002A39")]
	public List<Transform> m_Exclusions;

	// Token: 0x04002A3A RID: 10810
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4002A3A")]
	public DynamicBone.FreezeAxis m_FreezeAxis;

	// Token: 0x04002A3B RID: 10811
	[FieldOffset(Offset = "0xB4")]
	[Token(Token = "0x4002A3B")]
	public bool m_DistantDisable;

	// Token: 0x04002A3C RID: 10812
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4002A3C")]
	public Transform m_ReferenceObject;

	// Token: 0x04002A3D RID: 10813
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x4002A3D")]
	public float m_DistanceToObject;

	// Token: 0x04002A3E RID: 10814
	[FieldOffset(Offset = "0xC4")]
	[Token(Token = "0x4002A3E")]
	private Vector3 m_LocalGravity;

	// Token: 0x04002A3F RID: 10815
	[FieldOffset(Offset = "0xD0")]
	[Token(Token = "0x4002A3F")]
	private Vector3 m_ObjectMove;

	// Token: 0x04002A40 RID: 10816
	[FieldOffset(Offset = "0xDC")]
	[Token(Token = "0x4002A40")]
	private Vector3 m_ObjectPrevPosition;

	// Token: 0x04002A41 RID: 10817
	[FieldOffset(Offset = "0xE8")]
	[Token(Token = "0x4002A41")]
	private float m_BoneTotalLength;

	// Token: 0x04002A42 RID: 10818
	[FieldOffset(Offset = "0xEC")]
	[Token(Token = "0x4002A42")]
	private float m_ObjectScale;

	// Token: 0x04002A43 RID: 10819
	[FieldOffset(Offset = "0xF0")]
	[Token(Token = "0x4002A43")]
	private float m_Time;

	// Token: 0x04002A44 RID: 10820
	[FieldOffset(Offset = "0xF4")]
	[Token(Token = "0x4002A44")]
	private float m_Weight;

	// Token: 0x04002A45 RID: 10821
	[FieldOffset(Offset = "0xF8")]
	[Token(Token = "0x4002A45")]
	private bool m_DistantDisabled;

	// Token: 0x04002A46 RID: 10822
	[FieldOffset(Offset = "0x100")]
	[Token(Token = "0x4002A46")]
	private List<DynamicBone.Particle> m_Particles;

	// Token: 0x0200034C RID: 844
	[Token(Token = "0x200034C")]
	public enum UpdateMode
	{
		// Token: 0x04002A48 RID: 10824
		[Token(Token = "0x4002A48")]
		Normal,
		// Token: 0x04002A49 RID: 10825
		[Token(Token = "0x4002A49")]
		AnimatePhysics,
		// Token: 0x04002A4A RID: 10826
		[Token(Token = "0x4002A4A")]
		UnscaledTime
	}

	// Token: 0x0200034D RID: 845
	[Token(Token = "0x200034D")]
	public enum FreezeAxis
	{
		// Token: 0x04002A4C RID: 10828
		[Token(Token = "0x4002A4C")]
		None,
		// Token: 0x04002A4D RID: 10829
		[Token(Token = "0x4002A4D")]
		X,
		// Token: 0x04002A4E RID: 10830
		[Token(Token = "0x4002A4E")]
		Y,
		// Token: 0x04002A4F RID: 10831
		[Token(Token = "0x4002A4F")]
		Z
	}

	// Token: 0x0200034E RID: 846
	[Token(Token = "0x200034E")]
	private class Particle
	{
		// Token: 0x060020EA RID: 8426 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60020EA")]
		[Address(RVA = "0x5FCDC0", Offset = "0x5FBBC0", VA = "0x1805FCDC0")]
		public Particle()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04002A50 RID: 10832
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4002A50")]
		public Transform m_Transform;

		// Token: 0x04002A51 RID: 10833
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002A51")]
		public int m_ParentIndex;

		// Token: 0x04002A52 RID: 10834
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4002A52")]
		public float m_Damping;

		// Token: 0x04002A53 RID: 10835
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002A53")]
		public float m_Elasticity;

		// Token: 0x04002A54 RID: 10836
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x4002A54")]
		public float m_Stiffness;

		// Token: 0x04002A55 RID: 10837
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002A55")]
		public float m_Inert;

		// Token: 0x04002A56 RID: 10838
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4002A56")]
		public float m_Radius;

		// Token: 0x04002A57 RID: 10839
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002A57")]
		public float m_BoneLength;

		// Token: 0x04002A58 RID: 10840
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4002A58")]
		public Vector3 m_Position;

		// Token: 0x04002A59 RID: 10841
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002A59")]
		public Vector3 m_PrevPosition;

		// Token: 0x04002A5A RID: 10842
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4002A5A")]
		public Vector3 m_EndOffset;

		// Token: 0x04002A5B RID: 10843
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4002A5B")]
		public Vector3 m_InitLocalPosition;

		// Token: 0x04002A5C RID: 10844
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x4002A5C")]
		public Quaternion m_InitLocalRotation;
	}
}
