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

namespace Obi
{
	// Token: 0x020004A6 RID: 1190
	[Token(Token = "0x20004A6")]
	public abstract class ObiColliderBase : MonoBehaviour
	{
		// Token: 0x170002DC RID: 732
		// (get) Token: 0x06002A29 RID: 10793 RVA: 0x0005BE88 File Offset: 0x0005A088
		// (set) Token: 0x06002A28 RID: 10792 RVA: 0x0005BE44 File Offset: 0x0005A044
		[Token(Token = "0x170002DC")]
		public ObiCollisionMaterial CollisionMaterial
		{
			[Token(Token = "0x6002A29")]
			[Address(RVA = "0x2B4380", Offset = "0x2B3180", VA = "0x1802B4380")]
			get
			{
				return this.material;
			}
			[Token(Token = "0x6002A28")]
			[Address(RVA = "0x100C290", Offset = "0x100B090", VA = "0x18100C290")]
			set
			{
				this.material = value;
				ObiCollisionMaterial obiCollisionMaterial = this.material;
				int num = 0;
				if (!(obiCollisionMaterial != num))
				{
					int num2 = 0;
					Oni.SetColliderMaterial(this.oniCollider, (IntPtr)num2);
					return;
				}
				ObiCollisionMaterial obiCollisionMaterial2 = this.material;
				throw new NullReferenceException();
			}
		}

		// Token: 0x170002DD RID: 733
		// (get) Token: 0x06002A2A RID: 10794 RVA: 0x0005BE9C File Offset: 0x0005A09C
		[Token(Token = "0x170002DD")]
		public IntPtr OniCollider
		{
			[Token(Token = "0x6002A2A")]
			[Address(RVA = "0x31E490", Offset = "0x31D290", VA = "0x18031E490")]
			get
			{
				return this.oniCollider;
			}
		}

		// Token: 0x06002A2B RID: 10795
		[Token(Token = "0x6002A2B")]
		[Address(Slot = "4")]
		protected abstract void CreateTracker();

		// Token: 0x06002A2C RID: 10796
		[Token(Token = "0x6002A2C")]
		[Address(Slot = "5")]
		protected abstract bool IsUnityColliderEnabled();

		// Token: 0x06002A2D RID: 10797
		[Token(Token = "0x6002A2D")]
		[Address(Slot = "6")]
		protected abstract void UpdateColliderAdaptor();

		// Token: 0x06002A2E RID: 10798 RVA: 0x0005BEB0 File Offset: 0x0005A0B0
		[Token(Token = "0x6002A2E")]
		[Address(RVA = "0x100B1D0", Offset = "0x1009FD0", VA = "0x18100B1D0")]
		protected void CreateRigidbody()
		{
			this.obiRigidbody = (ulong)0L;
			Rigidbody componentInParent = base.GetComponentInParent<Rigidbody>();
			int num = 0;
			if (!(componentInParent != num))
			{
				int num2 = 0;
				Oni.SetColliderRigidbody(this.oniCollider, (IntPtr)num2);
				return;
			}
			ObiRigidbody component = componentInParent.GetComponent<ObiRigidbody>();
			this.obiRigidbody = component;
			ObiRigidbody obiRigidbody = this.obiRigidbody;
			int num3 = 0;
			if (obiRigidbody == num3)
			{
				ObiRigidbody obiRigidbody2 = componentInParent.gameObject.AddComponent<ObiRigidbody>();
				this.obiRigidbody = obiRigidbody2;
			}
			ObiRigidbody obiRigidbody3 = this.obiRigidbody;
			throw new NullReferenceException();
		}

		// Token: 0x06002A2F RID: 10799 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A2F")]
		[Address(RVA = "0x100BBF0", Offset = "0x100A9F0", VA = "0x18100BBF0")]
		public void RegisterInSolver(ObiSolver solver, bool addToSolver)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A30 RID: 10800 RVA: 0x0005BF30 File Offset: 0x0005A130
		[Token(Token = "0x6002A30")]
		[Address(RVA = "0x100BD00", Offset = "0x100AB00", VA = "0x18100BD00")]
		public void RemoveFromSolver(ObiSolver solver)
		{
			bool flag = this.solvers.Remove(solver);
			IntPtr intPtr = this.oniCollider;
			Oni.RemoveCollider(solver.oniSolver, intPtr);
		}

		// Token: 0x06002A31 RID: 10801 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A31")]
		[Address(RVA = "0x100B350", Offset = "0x100A150", VA = "0x18100B350")]
		private void FindSolvers(bool addToSolvers)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A32 RID: 10802 RVA: 0x0005BF64 File Offset: 0x0005A164
		[Token(Token = "0x6002A32")]
		[Address(RVA = "0x100C160", Offset = "0x100AF60", VA = "0x18100C160")]
		private void Update()
		{
			this.FindSolvers(true);
		}

		// Token: 0x06002A33 RID: 10803 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A33")]
		[Address(RVA = "0x100AC80", Offset = "0x1009A80", VA = "0x18100AC80", Slot = "7")]
		protected virtual void Awake()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A34 RID: 10804 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A34")]
		[Address(RVA = "0x100B640", Offset = "0x100A440", VA = "0x18100B640")]
		private void OnDestroy()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A35 RID: 10805 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A35")]
		[Address(RVA = "0x100BAF0", Offset = "0x100A8F0", VA = "0x18100BAF0")]
		public void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A36 RID: 10806 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A36")]
		[Address(RVA = "0x100B9F0", Offset = "0x100A7F0", VA = "0x18100B9F0")]
		public void OnDisable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A37 RID: 10807 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002A37")]
		[Address(RVA = "0x100BD70", Offset = "0x100AB70", VA = "0x18100BD70")]
		private void UpdateIfNeeded(object sender, EventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002A38 RID: 10808 RVA: 0x0005BF78 File Offset: 0x0005A178
		[Token(Token = "0x6002A38")]
		[Address(RVA = "0x100C0E0", Offset = "0x100AEE0", VA = "0x18100C0E0")]
		private void UpdateRigidbody(object sender, EventArgs e)
		{
			ObiRigidbody obiRigidbody = this.obiRigidbody;
			int num = 0;
			if (obiRigidbody != num)
			{
				this.obiRigidbody.UpdateVelocities();
			}
		}

		// Token: 0x06002A39 RID: 10809 RVA: 0x0005BFAC File Offset: 0x0005A1AC
		[Token(Token = "0x6002A39")]
		[Address(RVA = "0x100C1F0", Offset = "0x100AFF0", VA = "0x18100C1F0")]
		protected ObiColliderBase()
		{
			HashSet<ObiSolver> hashSet = new HashSet();
			this.solvers = hashSet;
			base..ctor();
		}

		// Token: 0x06002A3A RID: 10810 RVA: 0x0005BFEC File Offset: 0x0005A1EC
		// Note: this type is marked as 'beforefieldinit'.
		[Token(Token = "0x6002A3A")]
		[Address(RVA = "0x100C170", Offset = "0x100AF70", VA = "0x18100C170")]
		static ObiColliderBase()
		{
			/*
An exception occurred when decompiling this method (06002A3A)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void Obi.ObiColliderBase::.cctor()

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stsfld:class [mscorlib]System.Collections.Generic.Dictionary`2<int32, class [UnityEngine.CoreModule]UnityEngine.Component>(ObiColliderBase::idToCollider, newobj:Dictionary`2[exp:class [mscorlib]System.Collections.Generic.Dictionary`2<int32, class [UnityEngine.CoreModule]UnityEngine.Component>](Dictionary`2::.ctor)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
		}

		// Token: 0x0400331E RID: 13086
		[Token(Token = "0x400331E")]
		public static Dictionary<int, Component> idToCollider;

		// Token: 0x0400331F RID: 13087
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x400331F")]
		[HideInInspector]
		[SerializeField]
		private ObiCollisionMaterial material;

		// Token: 0x04003320 RID: 13088
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003320")]
		public int phase;

		// Token: 0x04003321 RID: 13089
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x4003321")]
		public float thickness;

		// Token: 0x04003322 RID: 13090
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x4003322")]
		[HideInInspector]
		[SerializeField]
		protected Component unityCollider;

		// Token: 0x04003323 RID: 13091
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003323")]
		protected IntPtr oniCollider = (IntPtr)((ulong)0L);

		// Token: 0x04003324 RID: 13092
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003324")]
		protected ObiRigidbody obiRigidbody;

		// Token: 0x04003325 RID: 13093
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x4003325")]
		protected int currentLayer = (int)((ulong)4294967295L);

		// Token: 0x04003326 RID: 13094
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003326")]
		protected bool wasUnityColliderEnabled = true;

		// Token: 0x04003327 RID: 13095
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003327")]
		protected float oldPhase;

		// Token: 0x04003328 RID: 13096
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003328")]
		protected float oldThickness;

		// Token: 0x04003329 RID: 13097
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003329")]
		protected HashSet<ObiSolver> solvers;

		// Token: 0x0400332A RID: 13098
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x400332A")]
		protected ObiShapeTracker tracker;

		// Token: 0x0400332B RID: 13099
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x400332B")]
		protected Oni.Collider adaptor;
	}
}
