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

namespace Obi
{
	// Token: 0x020004AD RID: 1197
	[Token(Token = "0x20004AD")]
	[Serializable]
	public class ObiDistanceConstraintBatch : ObiConstraintBatch
	{
		// Token: 0x06002A75 RID: 10869 RVA: 0x0005C5E4 File Offset: 0x0005A7E4
		[Token(Token = "0x6002A75")]
		[Address(RVA = "0x100E230", Offset = "0x100D030", VA = "0x18100E230")]
		public ObiDistanceConstraintBatch(bool cooked, bool sharesParticles)
		{
			List<int> list = new List();
			this.springIndices = list;
			List<float> list2 = new List();
			this.restLengths = list2;
			List<Vector2> list3 = new List();
			this.stiffnesses = list3;
			int[] array = new int[0];
			this.solverIndices = array;
			base..ctor(cooked, sharesParticles);
		}

		// Token: 0x06002A76 RID: 10870 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A76")]
		[Address(RVA = "0x100E380", Offset = "0x100D180", VA = "0x18100E380")]
		public ObiDistanceConstraintBatch(bool cooked, bool sharesParticles, float minYoungModulus, float maxYoungModulus)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A77 RID: 10871 RVA: 0x0005C630 File Offset: 0x0005A830
		[Token(Token = "0x6002A77")]
		[Address(RVA = "0x51C620", Offset = "0x51B420", VA = "0x18051C620", Slot = "4")]
		public override Oni.ConstraintType GetConstraintType()
		{
			return Oni.ConstraintType.Distance;
		}

		// Token: 0x06002A78 RID: 10872 RVA: 0x0005C640 File Offset: 0x0005A840
		[Token(Token = "0x6002A78")]
		[Address(RVA = "0x100D2D0", Offset = "0x100C0D0", VA = "0x18100D2D0", Slot = "5")]
		public override void Clear()
		{
			this.activeConstraints.Clear();
			this.springIndices.Clear();
			this.restLengths.Clear();
			this.stiffnesses.Clear();
			this.constraintCount = (int)((ulong)0L);
		}

		// Token: 0x06002A79 RID: 10873 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A79")]
		[Address(RVA = "0x100D1C0", Offset = "0x100BFC0", VA = "0x18100D1C0")]
		public void AddConstraint(int index1, int index2, float restLength, float stretchStiffness, float compressionStiffness)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A7A RID: 10874 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A7A")]
		[Address(RVA = "0x100D7E0", Offset = "0x100C5E0", VA = "0x18100D7E0")]
		public void InsertConstraint(int constraintIndex, int index1, int index2, float restLength, float stretchStiffness, float compressionStiffness)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A7B RID: 10875 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A7B")]
		[Address(RVA = "0x100E160", Offset = "0x100CF60", VA = "0x18100E160")]
		public void SetParticleIndex(int constraintIndex, int particleIndex, ObiDistanceConstraintBatch.DistanceIndexType type, bool wraparound)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A7C RID: 10876 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A7C")]
		[Address(RVA = "0x100DFB0", Offset = "0x100CDB0", VA = "0x18100DFB0")]
		public void RemoveConstraint(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A7D RID: 10877 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A7D")]
		[Address(RVA = "0x100D6C0", Offset = "0x100C4C0", VA = "0x18100D6C0", Slot = "11")]
		public override List<int> GetConstraintsInvolvingParticle(int particleIndex)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A7E RID: 10878 RVA: 0x0005C688 File Offset: 0x0005A888
		[Token(Token = "0x6002A7E")]
		[Address(RVA = "0x100D380", Offset = "0x100C180", VA = "0x18100D380", Slot = "6")]
		public override void Cook()
		{
			ulong num;
			IntPtr intPtr = Oni.CreateBatch(4, num != 0UL);
			List<int> list = this.springIndices;
			this.batch = intPtr;
			int[] array = list.ToArray();
			float[] array2 = this.restLengths.ToArray();
			Vector2[] array3 = this.stiffnesses.ToArray();
			int constraintCount = this.constraintCount;
			Oni.SetDistanceConstraints(intPtr, array, array2, array3, 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 num2 = this.constraintCount;
				num2 += num2;
				int[] array4 = new int[num2];
				float[] array5 = new float[this.constraintCount];
				Vector2[] array6 = new Vector2[this.constraintCount];
				Oni.GetDistanceConstraints(this.batch, array4, array5, array6);
				List<int> list3 = new List(array4);
				this.springIndices = list3;
				List<float> list4 = new List(array5);
				this.restLengths = list4;
				List<Vector2> list5 = new List(array6);
				this.stiffnesses = list5;
				int[] array7 = new int[Oni.GetBatchPhaseCount(this.batch)];
				Oni.GetBatchPhaseSizes(this.batch, array7);
				List<int> list6 = new List(array7);
				this.phaseSizes = list6;
			}
			Oni.DestroyBatch(this.batch);
			this.batch = (IntPtr)((ulong)0L);
		}

		// Token: 0x06002A7F RID: 10879 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A7F")]
		[Address(RVA = "0x100D9E0", Offset = "0x100C7E0", VA = "0x18100D9E0", Slot = "7")]
		protected override void OnAddToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A80 RID: 10880 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A80")]
		[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: 0x06002A81 RID: 10881 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A81")]
		[Address(RVA = "0x100DC00", Offset = "0x100CA00", VA = "0x18100DC00", Slot = "9")]
		public override void PushDataToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A82 RID: 10882 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A82")]
		[Address(RVA = "0x297F00", Offset = "0x296D00", VA = "0x180297F00", Slot = "10")]
		public override void PullDataFromSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0400334E RID: 13134
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400334E")]
		[HideInInspector]
		public List<int> springIndices;

		// Token: 0x0400334F RID: 13135
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400334F")]
		[HideInInspector]
		public List<float> restLengths;

		// Token: 0x04003350 RID: 13136
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003350")]
		[HideInInspector]
		public List<Vector2> stiffnesses;

		// Token: 0x04003351 RID: 13137
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003351")]
		private int[] solverIndices;

		// Token: 0x020004AE RID: 1198
		[Token(Token = "0x20004AE")]
		public enum DistanceIndexType
		{
			// Token: 0x04003353 RID: 13139
			[Token(Token = "0x4003353")]
			First,
			// Token: 0x04003354 RID: 13140
			[Token(Token = "0x4003354")]
			Second
		}
	}
}
