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

// Token: 0x020003A3 RID: 931
[Token(Token = "0x20003A3")]
[AddComponentMenu("Dynamic Bone/Dynamic Bone")]
public class DynamicBone : MonoBehaviour
{
	// Token: 0x0600239B RID: 9115 RVA: 0x000554A8 File Offset: 0x000536A8
	[Token(Token = "0x600239B")]
	[Address(RVA = "0x15982A0", Offset = "0x15972A0", VA = "0x1815982A0")]
	private void Start()
	{
		this.SetupParticles();
	}

	// Token: 0x0600239C RID: 9116 RVA: 0x000554BC File Offset: 0x000536BC
	[Token(Token = "0x600239C")]
	[Address(RVA = "0x1597080", Offset = "0x1596080", VA = "0x181597080")]
	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: 0x0600239D RID: 9117 RVA: 0x000554F8 File Offset: 0x000536F8
	[Token(Token = "0x600239D")]
	[Address(RVA = "0x1599750", Offset = "0x1598750", VA = "0x181599750")]
	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: 0x0600239E RID: 9118 RVA: 0x00055534 File Offset: 0x00053734
	[Token(Token = "0x600239E")]
	[Address(RVA = "0x1597230", Offset = "0x1596230", VA = "0x181597230")]
	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: 0x0600239F RID: 9119 RVA: 0x00055580 File Offset: 0x00053780
	[Token(Token = "0x600239F")]
	[Address(RVA = "0x1597670", Offset = "0x1596670", VA = "0x181597670")]
	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: 0x060023A0 RID: 9120 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023A0")]
	[Address(RVA = "0x1596E90", Offset = "0x1595E90", VA = "0x181596E90")]
	private void CheckDistance()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023A1 RID: 9121 RVA: 0x000555B4 File Offset: 0x000537B4
	[Token(Token = "0x60023A1")]
	[Address(RVA = "0x15975B0", Offset = "0x15965B0", VA = "0x1815975B0")]
	private void OnEnable()
	{
		this.ResetParticlesPosition();
	}

	// Token: 0x060023A2 RID: 9122 RVA: 0x000555C8 File Offset: 0x000537C8
	[Token(Token = "0x60023A2")]
	[Address(RVA = "0x1597370", Offset = "0x1596370", VA = "0x181597370")]
	private void OnDisable()
	{
		this.InitTransforms();
	}

	// Token: 0x060023A3 RID: 9123 RVA: 0x000555DC File Offset: 0x000537DC
	[Token(Token = "0x60023A3")]
	[Address(RVA = "0x15975C0", Offset = "0x15965C0", VA = "0x1815975C0")]
	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: 0x060023A4 RID: 9124 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023A4")]
	[Address(RVA = "0x1597380", Offset = "0x1596380", VA = "0x181597380")]
	private void OnDrawGizmosSelected()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023A5 RID: 9125 RVA: 0x00055694 File Offset: 0x00053894
	[Token(Token = "0x60023A5")]
	[Address(RVA = "0x1597880", Offset = "0x1596880", VA = "0x181597880")]
	public void SetWeight(float w)
	{
		this.InitTransforms();
		this.m_Weight = w;
	}

	// Token: 0x060023A6 RID: 9126 RVA: 0x000556BC File Offset: 0x000538BC
	[Token(Token = "0x60023A6")]
	[Address(RVA = "0x15970C0", Offset = "0x15960C0", VA = "0x1815970C0")]
	public float GetWeight()
	{
		return this.m_Weight;
	}

	// Token: 0x060023A7 RID: 9127 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023A7")]
	[Address(RVA = "0x15982B0", Offset = "0x15972B0", VA = "0x1815982B0")]
	private void UpdateDynamicBones(float t)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023A8 RID: 9128 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023A8")]
	[Address(RVA = "0x15978F0", Offset = "0x15968F0", VA = "0x1815978F0")]
	private void SetupParticles()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023A9 RID: 9129 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023A9")]
	[Address(RVA = "0x1596390", Offset = "0x1595390", VA = "0x181596390")]
	private void AppendParticles(Transform b, int parentIndex, float boneLength)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AA RID: 9130 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AA")]
	[Address(RVA = "0x1598500", Offset = "0x1597500", VA = "0x181598500")]
	public void UpdateParameters()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AB RID: 9131 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AB")]
	[Address(RVA = "0x15970D0", Offset = "0x15960D0", VA = "0x1815970D0")]
	private void InitTransforms()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AC RID: 9132 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AC")]
	[Address(RVA = "0x15976A0", Offset = "0x15966A0", VA = "0x1815976A0")]
	private void ResetParticlesPosition()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AD RID: 9133 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AD")]
	[Address(RVA = "0x1598880", Offset = "0x1597880", VA = "0x181598880")]
	private void UpdateParticles1()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AE RID: 9134 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AE")]
	[Address(RVA = "0x1598CE0", Offset = "0x1597CE0", VA = "0x181598CE0")]
	private void UpdateParticles2()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023AF RID: 9135 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023AF")]
	[Address(RVA = "0x1597A90", Offset = "0x1596A90", VA = "0x181597A90")]
	private void SkipUpdateParticles()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023B0 RID: 9136 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023B0")]
	[Address(RVA = "0x1597290", Offset = "0x1596290", VA = "0x181597290")]
	private static Vector3 MirrorVector(Vector3 v, Vector3 axis)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023B1 RID: 9137 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60023B1")]
	[Address(RVA = "0x1596B30", Offset = "0x1595B30", VA = "0x181596B30")]
	private void ApplyParticlesToTransforms()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060023B2 RID: 9138 RVA: 0x000556D0 File Offset: 0x000538D0
	[Token(Token = "0x60023B2")]
	[Address(RVA = "0x1599790", Offset = "0x1598790", VA = "0x181599790")]
	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: 0x04002D11 RID: 11537
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002D11")]
	public Transform m_Root;

	// Token: 0x04002D12 RID: 11538
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002D12")]
	public float m_UpdateRate = 60f;

	// Token: 0x04002D13 RID: 11539
	[FieldOffset(Offset = "0x24")]
	[Token(Token = "0x4002D13")]
	public DynamicBone.UpdateMode m_UpdateMode;

	// Token: 0x04002D14 RID: 11540
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002D14")]
	[Range(0f, 1f)]
	public float m_Damping = 0.1f;

	// Token: 0x04002D15 RID: 11541
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4002D15")]
	public AnimationCurve m_DampingDistrib;

	// Token: 0x04002D16 RID: 11542
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002D16")]
	[Range(0f, 1f)]
	public float m_Elasticity = 0.1f;

	// Token: 0x04002D17 RID: 11543
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4002D17")]
	public AnimationCurve m_ElasticityDistrib;

	// Token: 0x04002D18 RID: 11544
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002D18")]
	[Range(0f, 1f)]
	public float m_Stiffness = 0.1f;

	// Token: 0x04002D19 RID: 11545
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4002D19")]
	public AnimationCurve m_StiffnessDistrib;

	// Token: 0x04002D1A RID: 11546
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002D1A")]
	[Range(0f, 1f)]
	public float m_Inert;

	// Token: 0x04002D1B RID: 11547
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4002D1B")]
	public AnimationCurve m_InertDistrib;

	// Token: 0x04002D1C RID: 11548
	[FieldOffset(Offset = "0x68")]
	[Token(Token = "0x4002D1C")]
	public float m_Radius;

	// Token: 0x04002D1D RID: 11549
	[FieldOffset(Offset = "0x70")]
	[Token(Token = "0x4002D1D")]
	public AnimationCurve m_RadiusDistrib;

	// Token: 0x04002D1E RID: 11550
	[FieldOffset(Offset = "0x78")]
	[Token(Token = "0x4002D1E")]
	public float m_EndLength;

	// Token: 0x04002D1F RID: 11551
	[FieldOffset(Offset = "0x7C")]
	[Token(Token = "0x4002D1F")]
	public Vector3 m_EndOffset;

	// Token: 0x04002D20 RID: 11552
	[FieldOffset(Offset = "0x88")]
	[Token(Token = "0x4002D20")]
	public Vector3 m_Gravity;

	// Token: 0x04002D21 RID: 11553
	[FieldOffset(Offset = "0x94")]
	[Token(Token = "0x4002D21")]
	public Vector3 m_Force;

	// Token: 0x04002D22 RID: 11554
	[FieldOffset(Offset = "0xA0")]
	[Token(Token = "0x4002D22")]
	public List<DynamicBoneColliderBase> m_Colliders;

	// Token: 0x04002D23 RID: 11555
	[FieldOffset(Offset = "0xA8")]
	[Token(Token = "0x4002D23")]
	public List<Transform> m_Exclusions;

	// Token: 0x04002D24 RID: 11556
	[FieldOffset(Offset = "0xB0")]
	[Token(Token = "0x4002D24")]
	public DynamicBone.FreezeAxis m_FreezeAxis;

	// Token: 0x04002D25 RID: 11557
	[FieldOffset(Offset = "0xB4")]
	[Token(Token = "0x4002D25")]
	public bool m_DistantDisable;

	// Token: 0x04002D26 RID: 11558
	[FieldOffset(Offset = "0xB8")]
	[Token(Token = "0x4002D26")]
	public Transform m_ReferenceObject;

	// Token: 0x04002D27 RID: 11559
	[FieldOffset(Offset = "0xC0")]
	[Token(Token = "0x4002D27")]
	public float m_DistanceToObject;

	// Token: 0x04002D28 RID: 11560
	[FieldOffset(Offset = "0xC4")]
	[Token(Token = "0x4002D28")]
	private Vector3 m_LocalGravity;

	// Token: 0x04002D29 RID: 11561
	[FieldOffset(Offset = "0xD0")]
	[Token(Token = "0x4002D29")]
	private Vector3 m_ObjectMove;

	// Token: 0x04002D2A RID: 11562
	[FieldOffset(Offset = "0xDC")]
	[Token(Token = "0x4002D2A")]
	private Vector3 m_ObjectPrevPosition;

	// Token: 0x04002D2B RID: 11563
	[FieldOffset(Offset = "0xE8")]
	[Token(Token = "0x4002D2B")]
	private float m_BoneTotalLength;

	// Token: 0x04002D2C RID: 11564
	[FieldOffset(Offset = "0xEC")]
	[Token(Token = "0x4002D2C")]
	private float m_ObjectScale;

	// Token: 0x04002D2D RID: 11565
	[FieldOffset(Offset = "0xF0")]
	[Token(Token = "0x4002D2D")]
	private float m_Time;

	// Token: 0x04002D2E RID: 11566
	[FieldOffset(Offset = "0xF4")]
	[Token(Token = "0x4002D2E")]
	private float m_Weight;

	// Token: 0x04002D2F RID: 11567
	[FieldOffset(Offset = "0xF8")]
	[Token(Token = "0x4002D2F")]
	private bool m_DistantDisabled;

	// Token: 0x04002D30 RID: 11568
	[FieldOffset(Offset = "0x100")]
	[Token(Token = "0x4002D30")]
	private List<DynamicBone.Particle> m_Particles;

	// Token: 0x020003A4 RID: 932
	[Token(Token = "0x20003A4")]
	public enum UpdateMode
	{
		// Token: 0x04002D32 RID: 11570
		[Token(Token = "0x4002D32")]
		Normal,
		// Token: 0x04002D33 RID: 11571
		[Token(Token = "0x4002D33")]
		AnimatePhysics,
		// Token: 0x04002D34 RID: 11572
		[Token(Token = "0x4002D34")]
		UnscaledTime
	}

	// Token: 0x020003A5 RID: 933
	[Token(Token = "0x20003A5")]
	public enum FreezeAxis
	{
		// Token: 0x04002D36 RID: 11574
		[Token(Token = "0x4002D36")]
		None,
		// Token: 0x04002D37 RID: 11575
		[Token(Token = "0x4002D37")]
		X,
		// Token: 0x04002D38 RID: 11576
		[Token(Token = "0x4002D38")]
		Y,
		// Token: 0x04002D39 RID: 11577
		[Token(Token = "0x4002D39")]
		Z
	}

	// Token: 0x020003A6 RID: 934
	[Token(Token = "0x20003A6")]
	private class Particle
	{
		// Token: 0x060023B3 RID: 9139 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60023B3")]
		[Address(RVA = "0x19BD7F0", Offset = "0x19BC7F0", VA = "0x1819BD7F0")]
		public Particle()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04002D3A RID: 11578
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4002D3A")]
		public Transform m_Transform;

		// Token: 0x04002D3B RID: 11579
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002D3B")]
		public int m_ParentIndex;

		// Token: 0x04002D3C RID: 11580
		[FieldOffset(Offset = "0x1C")]
		[Token(Token = "0x4002D3C")]
		public float m_Damping;

		// Token: 0x04002D3D RID: 11581
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002D3D")]
		public float m_Elasticity;

		// Token: 0x04002D3E RID: 11582
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x4002D3E")]
		public float m_Stiffness;

		// Token: 0x04002D3F RID: 11583
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4002D3F")]
		public float m_Inert;

		// Token: 0x04002D40 RID: 11584
		[FieldOffset(Offset = "0x2C")]
		[Token(Token = "0x4002D40")]
		public float m_Radius;

		// Token: 0x04002D41 RID: 11585
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4002D41")]
		public float m_BoneLength;

		// Token: 0x04002D42 RID: 11586
		[FieldOffset(Offset = "0x34")]
		[Token(Token = "0x4002D42")]
		public Vector3 m_Position;

		// Token: 0x04002D43 RID: 11587
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4002D43")]
		public Vector3 m_PrevPosition;

		// Token: 0x04002D44 RID: 11588
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4002D44")]
		public Vector3 m_EndOffset;

		// Token: 0x04002D45 RID: 11589
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4002D45")]
		public Vector3 m_InitLocalPosition;

		// Token: 0x04002D46 RID: 11590
		[FieldOffset(Offset = "0x64")]
		[Token(Token = "0x4002D46")]
		public Quaternion m_InitLocalRotation;
	}
}
