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

namespace Obi
{
	// Token: 0x02000508 RID: 1288
	[Token(Token = "0x2000508")]
	[Serializable]
	public class ObiSkinConstraintBatch : ObiConstraintBatch
	{
		// Token: 0x06002D58 RID: 11608 RVA: 0x00063BE4 File Offset: 0x00061DE4
		[Token(Token = "0x6002D58")]
		[Address(RVA = "0xE5A4A0", Offset = "0xE594A0", VA = "0x180E5A4A0")]
		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: 0x06002D59 RID: 11609 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D59")]
		[Address(RVA = "0xE5A650", Offset = "0xE59650", VA = "0x180E5A650")]
		public ObiSkinConstraintBatch(bool cooked, bool sharesParticles, float minYoungModulus, float maxYoungModulus)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D5A RID: 11610 RVA: 0x00063C4C File Offset: 0x00061E4C
		[Token(Token = "0x6002D5A")]
		[Address(RVA = "0xA48400", Offset = "0xA47400", VA = "0x180A48400", Slot = "4")]
		public override Oni.ConstraintType GetConstraintType()
		{
			return Oni.ConstraintType.Skin;
		}

		// Token: 0x06002D5B RID: 11611 RVA: 0x00063C5C File Offset: 0x00061E5C
		[Token(Token = "0x6002D5B")]
		[Address(RVA = "0xE59490", Offset = "0xE58490", VA = "0x180E59490", 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: 0x06002D5C RID: 11612 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D5C")]
		[Address(RVA = "0xE59320", Offset = "0xE58320", VA = "0x180E59320")]
		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: 0x06002D5D RID: 11613 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D5D")]
		[Address(RVA = "0xE5A2B0", Offset = "0xE592B0", VA = "0x180E5A2B0")]
		public void RemoveConstraint(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D5E RID: 11614 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D5E")]
		[Address(RVA = "0xE59980", Offset = "0xE58980", VA = "0x180E59980", Slot = "11")]
		public override List<int> GetConstraintsInvolvingParticle(int particleIndex)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D5F RID: 11615 RVA: 0x00063CBC File Offset: 0x00061EBC
		[Token(Token = "0x6002D5F")]
		[Address(RVA = "0xE59570", Offset = "0xE58570", VA = "0x180E59570", 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: 0x06002D60 RID: 11616 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D60")]
		[Address(RVA = "0xE59BC0", Offset = "0xE58BC0", VA = "0x180E59BC0", Slot = "7")]
		protected override void OnAddToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D61 RID: 11617 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D61")]
		[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: 0x06002D62 RID: 11618 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D62")]
		[Address(RVA = "0xE59FD0", Offset = "0xE58FD0", VA = "0x180E59FD0", Slot = "9")]
		public override void PushDataToSolver(ObiBatchedConstraints constraints)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D63 RID: 11619 RVA: 0x00063E64 File Offset: 0x00062064
		[Token(Token = "0x6002D63")]
		[Address(RVA = "0xE59DC0", Offset = "0xE58DC0", VA = "0x180E59DC0", 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: 0x06002D64 RID: 11620 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D64")]
		[Address(RVA = "0xE59B20", Offset = "0xE58B20", VA = "0x180E59B20")]
		public Vector3 GetSkinPosition(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D65 RID: 11621 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D65")]
		[Address(RVA = "0xE59A80", Offset = "0xE58A80", VA = "0x180E59A80")]
		public Vector3 GetSkinNormal(int index)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x04003646 RID: 13894
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003646")]
		[HideInInspector]
		public List<int> skinIndices;

		// Token: 0x04003647 RID: 13895
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003647")]
		[HideInInspector]
		public List<Vector4> skinPoints;

		// Token: 0x04003648 RID: 13896
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003648")]
		[HideInInspector]
		public List<Vector4> skinNormals;

		// Token: 0x04003649 RID: 13897
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003649")]
		[HideInInspector]
		public List<float> skinRadiiBackstop;

		// Token: 0x0400364A RID: 13898
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x400364A")]
		[HideInInspector]
		public List<float> skinStiffnesses;

		// Token: 0x0400364B RID: 13899
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x400364B")]
		private int[] solverIndices;
	}
}
