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

namespace Obi
{
	// Token: 0x020004B0 RID: 1200
	[Token(Token = "0x20004B0")]
	[Serializable]
	public class ObiSkinConstraintBatch : ObiConstraintBatch
	{
		// Token: 0x06002A8F RID: 10895 RVA: 0x0005C8C8 File Offset: 0x0005AAC8
		[Token(Token = "0x6002A8F")]
		[Address(RVA = "0xD29330", Offset = "0xD28130", VA = "0x180D29330")]
		public ObiSkinConstraintBatch(bool cooked, bool sharesParticles)
		{
			List<int> list = new List();
			this.skinIndices = list;
			List<Vector4> list2 = new List();
			this.skinPoints = list2;
			List<Vector4> list3 = new List();
			this.skinNormals = list3;
			List<float> list4 = new List();
			this.skinRadiiBackstop = list4;
			List<float> list5 = new List();
			this.skinStiffnesses = list5;
			int[] array = new int[0];
			this.solverIndices = array;
			base..ctor(cooked, sharesParticles);
		}

		// Token: 0x06002A90 RID: 10896 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A90")]
		[Address(RVA = "0xD294E0", Offset = "0xD282E0", VA = "0x180D294E0")]
		public ObiSkinConstraintBatch(bool cooked, bool sharesParticles, float minYoungModulus, float maxYoungModulus)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A91 RID: 10897 RVA: 0x0005C930 File Offset: 0x0005AB30
		[Token(Token = "0x6002A91")]
		[Address(RVA = "0x970830", Offset = "0x96F630", VA = "0x180970830", Slot = "4")]
		public override Oni.ConstraintType GetConstraintType()
		{
			return Oni.ConstraintType.Skin;
		}

		// Token: 0x06002A92 RID: 10898 RVA: 0x0005C940 File Offset: 0x0005AB40
		[Token(Token = "0x6002A92")]
		[Address(RVA = "0xD28320", Offset = "0xD27120", VA = "0x180D28320", Slot = "5")]
		public override void Clear()
		{
			this.activeConstraints.Clear();
			this.skinIndices.Clear();
			this.skinPoints.Clear();
			this.skinNormals.Clear();
			this.skinRadiiBackstop.Clear();
			this.skinStiffnesses.Clear();
			this.constraintCount = (int)((ulong)0L);
		}

		// Token: 0x06002A93 RID: 10899 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A93")]
		[Address(RVA = "0xD281B0", Offset = "0xD26FB0", VA = "0x180D281B0")]
		public void AddConstraint(int index, Vector4 point, Vector4 normal, float radius, float collisionRadius, float backstop, float stiffness)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A94 RID: 10900 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A94")]
		[Address(RVA = "0xD29140", Offset = "0xD27F40", VA = "0x180D29140")]
		public void RemoveConstraint(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A95 RID: 10901 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A95")]
		[Address(RVA = "0xD28810", Offset = "0xD27610", VA = "0x180D28810", Slot = "11")]
		public override List<int> GetConstraintsInvolvingParticle(int particleIndex)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A96 RID: 10902 RVA: 0x0005C9A0 File Offset: 0x0005ABA0
		[Token(Token = "0x6002A96")]
		[Address(RVA = "0xD28400", Offset = "0xD27200", VA = "0x180D28400", Slot = "6")]
		public override void Cook()
		{
			IntPtr intPtr = Oni.CreateBatch(8, true);
			List<int> list = this.skinIndices;
			this.batch = intPtr;
			int[] array = list.ToArray();
			Vector4[] array2 = this.skinPoints.ToArray();
			Vector4[] array3 = this.skinNormals.ToArray();
			float[] array4 = this.skinRadiiBackstop.ToArray();
			float[] array5 = this.skinStiffnesses.ToArray();
			int constraintCount = this.constraintCount;
			Oni.SetSkinConstraints(intPtr, array, array2, array3, array4, array5, constraintCount);
			if (Oni.CookBatch(this.batch))
			{
				int batchConstraintCount = Oni.GetBatchConstraintCount(this.batch);
				this.constraintCount = batchConstraintCount;
				List<int> list2 = Enumerable.ToList<int>(Enumerable.Range(0, batchConstraintCount));
				this.activeConstraints = list2;
				int[] array6 = new int[this.constraintCount];
				Vector4[] array7 = new Vector4[this.constraintCount];
				int constraintCount2 = this.constraintCount;
				Vector4[] array8 = new Vector4[constraintCount2];
				float[] array9 = new float[constraintCount2];
				float[] array10 = new float[this.constraintCount];
				Oni.GetSkinConstraints(this.batch, array6, array7, array8, array9, array10);
				List<int> list3 = new List(array6);
				this.skinIndices = list3;
				List<Vector4> list4 = new List(array7);
				this.skinPoints = list4;
				List<Vector4> list5 = new List(array8);
				this.skinNormals = list5;
				List<float> list6 = new List(array9);
				this.skinRadiiBackstop = list6;
				List<float> list7 = new List(array10);
				this.skinStiffnesses = list7;
				int[] array11 = new int[Oni.GetBatchPhaseCount(this.batch)];
				Oni.GetBatchPhaseSizes(this.batch, array11);
				List<int> list8 = new List(array11);
				this.phaseSizes = list8;
			}
			Oni.DestroyBatch(this.batch);
			this.batch = (IntPtr)((ulong)0L);
		}

		// Token: 0x06002A97 RID: 10903 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A97")]
		[Address(RVA = "0xD28A50", Offset = "0xD27850", VA = "0x180D28A50", Slot = "7")]
		protected override void OnAddToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A98 RID: 10904 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A98")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "8")]
		protected override void OnRemoveFromSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A99 RID: 10905 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A99")]
		[Address(RVA = "0xD28E60", Offset = "0xD27C60", VA = "0x180D28E60", Slot = "9")]
		public override void PushDataToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A9A RID: 10906 RVA: 0x0005CB48 File Offset: 0x0005AD48
		[Token(Token = "0x6002A9A")]
		[Address(RVA = "0xD28C50", Offset = "0xD27A50", VA = "0x180D28C50", Slot = "10")]
		public override void PullDataFromSolver(ObiBatchedConstraints constraints)
		{
			int num = 0;
			if (!(constraints == num))
			{
				ObiActor actor = constraints.actor;
				int num2 = 0;
				if (!(actor == num2) && constraints.actor.inSolver)
				{
					int[] array = new int[this.constraintCount];
					Vector4[] array2 = new Vector4[this.constraintCount];
					int constraintCount = this.constraintCount;
					Vector4[] array3 = new Vector4[constraintCount];
					float[] array4 = new float[constraintCount];
					float[] array5 = new float[this.constraintCount];
					Oni.GetSkinConstraints(this.batch, array, array2, array3, array4, array5);
					List<Vector4> list = new List(array2);
					this.skinPoints = list;
					List<Vector4> list2 = new List(array3);
					this.skinNormals = list2;
				}
			}
		}

		// Token: 0x06002A9B RID: 10907 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A9B")]
		[Address(RVA = "0xD289B0", Offset = "0xD277B0", VA = "0x180D289B0")]
		public Vector3 GetSkinPosition(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A9C RID: 10908 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A9C")]
		[Address(RVA = "0xD28910", Offset = "0xD27710", VA = "0x180D28910")]
		public Vector3 GetSkinNormal(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0400335C RID: 13148
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400335C")]
		[HideInInspector]
		public List<int> skinIndices;

		// Token: 0x0400335D RID: 13149
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400335D")]
		[HideInInspector]
		public List<Vector4> skinPoints;

		// Token: 0x0400335E RID: 13150
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400335E")]
		[HideInInspector]
		public List<Vector4> skinNormals;

		// Token: 0x0400335F RID: 13151
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x400335F")]
		[HideInInspector]
		public List<float> skinRadiiBackstop;

		// Token: 0x04003360 RID: 13152
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003360")]
		[HideInInspector]
		public List<float> skinStiffnesses;

		// Token: 0x04003361 RID: 13153
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003361")]
		private int[] solverIndices;
	}
}
