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

namespace Obi
{
	// Token: 0x02000505 RID: 1285
	[Token(Token = "0x2000505")]
	[Serializable]
	public class ObiDistanceConstraintBatch : ObiConstraintBatch
	{
		// Token: 0x06002D3E RID: 11582 RVA: 0x00063900 File Offset: 0x00061B00
		[Token(Token = "0x6002D3E")]
		[Address(RVA = "0x10A1560", Offset = "0x10A0560", VA = "0x1810A1560")]
		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: 0x06002D3F RID: 11583 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D3F")]
		[Address(RVA = "0x10A16B0", Offset = "0x10A06B0", VA = "0x1810A16B0")]
		public ObiDistanceConstraintBatch(bool cooked, bool sharesParticles, float minYoungModulus, float maxYoungModulus)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D40 RID: 11584 RVA: 0x0006394C File Offset: 0x00061B4C
		[Token(Token = "0x6002D40")]
		[Address(RVA = "0x547930", Offset = "0x546930", VA = "0x180547930", Slot = "4")]
		public override Oni.ConstraintType GetConstraintType()
		{
			return Oni.ConstraintType.Distance;
		}

		// Token: 0x06002D41 RID: 11585 RVA: 0x0006395C File Offset: 0x00061B5C
		[Token(Token = "0x6002D41")]
		[Address(RVA = "0x10A0600", Offset = "0x109F600", VA = "0x1810A0600", Slot = "5")]
		public override void Clear()
		{
			this.activeConstraints.Clear();
			this.springIndices.Clear();
			this.restLengths.Clear();
			this.stiffnesses.Clear();
			this.constraintCount = (int)((ulong)0L);
		}

		// Token: 0x06002D42 RID: 11586 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D42")]
		[Address(RVA = "0x10A04F0", Offset = "0x109F4F0", VA = "0x1810A04F0")]
		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: 0x06002D43 RID: 11587 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D43")]
		[Address(RVA = "0x10A0B10", Offset = "0x109FB10", VA = "0x1810A0B10")]
		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: 0x06002D44 RID: 11588 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D44")]
		[Address(RVA = "0x10A1490", Offset = "0x10A0490", VA = "0x1810A1490")]
		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: 0x06002D45 RID: 11589 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D45")]
		[Address(RVA = "0x10A12E0", Offset = "0x10A02E0", VA = "0x1810A12E0")]
		public void RemoveConstraint(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D46 RID: 11590 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D46")]
		[Address(RVA = "0x10A09F0", Offset = "0x109F9F0", VA = "0x1810A09F0", Slot = "11")]
		public override List<int> GetConstraintsInvolvingParticle(int particleIndex)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D47 RID: 11591 RVA: 0x000639A4 File Offset: 0x00061BA4
		[Token(Token = "0x6002D47")]
		[Address(RVA = "0x10A06B0", Offset = "0x109F6B0", VA = "0x1810A06B0", 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: 0x06002D48 RID: 11592 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D48")]
		[Address(RVA = "0x10A0D10", Offset = "0x109FD10", VA = "0x1810A0D10", Slot = "7")]
		protected override void OnAddToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D49 RID: 11593 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D49")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "8")]
		protected override void OnRemoveFromSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D4A RID: 11594 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D4A")]
		[Address(RVA = "0x10A0F30", Offset = "0x109FF30", VA = "0x1810A0F30", Slot = "9")]
		public override void PushDataToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D4B RID: 11595 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D4B")]
		[Address(RVA = "0x29E8B0", Offset = "0x29D8B0", VA = "0x18029E8B0", Slot = "10")]
		public override void PullDataFromSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04003638 RID: 13880
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003638")]
		[HideInInspector]
		public List<int> springIndices;

		// Token: 0x04003639 RID: 13881
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003639")]
		[HideInInspector]
		public List<float> restLengths;

		// Token: 0x0400363A RID: 13882
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x400363A")]
		[HideInInspector]
		public List<Vector2> stiffnesses;

		// Token: 0x0400363B RID: 13883
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x400363B")]
		private int[] solverIndices;

		// Token: 0x02000506 RID: 1286
		[Token(Token = "0x2000506")]
		public enum DistanceIndexType
		{
			// Token: 0x0400363D RID: 13885
			[Token(Token = "0x400363D")]
			First,
			// Token: 0x0400363E RID: 13886
			[Token(Token = "0x400363E")]
			Second
		}
	}
}
