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

namespace Obi
{
	// Token: 0x020004FE RID: 1278
	[Token(Token = "0x20004FE")]
	public abstract class ObiColliderBase : MonoBehaviour
	{
		// Token: 0x17000301 RID: 769
		// (get) Token: 0x06002CF2 RID: 11506 RVA: 0x0006324C File Offset: 0x0006144C
		// (set) Token: 0x06002CF1 RID: 11505 RVA: 0x00063208 File Offset: 0x00061408
		[Token(Token = "0x17000301")]
		public ObiCollisionMaterial CollisionMaterial
		{
			[Token(Token = "0x6002CF2")]
			[Address(RVA = "0x2EF530", Offset = "0x2EE530", VA = "0x1802EF530")]
			get
			{
				return this.material;
			}
			[Token(Token = "0x6002CF1")]
			[Address(RVA = "0x109F5C0", Offset = "0x109E5C0", VA = "0x18109F5C0")]
			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: 0x17000302 RID: 770
		// (get) Token: 0x06002CF3 RID: 11507 RVA: 0x00063260 File Offset: 0x00061460
		[Token(Token = "0x17000302")]
		public IntPtr OniCollider
		{
			[Token(Token = "0x6002CF3")]
			[Address(RVA = "0x33F2F0", Offset = "0x33E2F0", VA = "0x18033F2F0")]
			get
			{
				return this.oniCollider;
			}
		}

		// Token: 0x06002CF4 RID: 11508
		[Token(Token = "0x6002CF4")]
		[Address(Slot = "4")]
		protected abstract void CreateTracker();

		// Token: 0x06002CF5 RID: 11509
		[Token(Token = "0x6002CF5")]
		[Address(Slot = "5")]
		protected abstract bool IsUnityColliderEnabled();

		// Token: 0x06002CF6 RID: 11510
		[Token(Token = "0x6002CF6")]
		[Address(Slot = "6")]
		protected abstract void UpdateColliderAdaptor();

		// Token: 0x06002CF7 RID: 11511 RVA: 0x00063274 File Offset: 0x00061474
		[Token(Token = "0x6002CF7")]
		[Address(RVA = "0x109E500", Offset = "0x109D500", VA = "0x18109E500")]
		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: 0x06002CF8 RID: 11512 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CF8")]
		[Address(RVA = "0x109EF20", Offset = "0x109DF20", VA = "0x18109EF20")]
		public void RegisterInSolver(ObiSolver solver, bool addToSolver)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002CF9 RID: 11513 RVA: 0x000632F4 File Offset: 0x000614F4
		[Token(Token = "0x6002CF9")]
		[Address(RVA = "0x109F030", Offset = "0x109E030", VA = "0x18109F030")]
		public void RemoveFromSolver(ObiSolver solver)
		{
			bool flag = this.solvers.Remove(solver);
			IntPtr intPtr = this.oniCollider;
			Oni.RemoveCollider(solver.oniSolver, intPtr);
		}

		// Token: 0x06002CFA RID: 11514 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CFA")]
		[Address(RVA = "0x109E680", Offset = "0x109D680", VA = "0x18109E680")]
		private void FindSolvers(bool addToSolvers)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002CFB RID: 11515 RVA: 0x00063328 File Offset: 0x00061528
		[Token(Token = "0x6002CFB")]
		[Address(RVA = "0x109F490", Offset = "0x109E490", VA = "0x18109F490")]
		private void Update()
		{
			this.FindSolvers(true);
		}

		// Token: 0x06002CFC RID: 11516 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CFC")]
		[Address(RVA = "0x109DFB0", Offset = "0x109CFB0", VA = "0x18109DFB0", Slot = "7")]
		protected virtual void Awake()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002CFD RID: 11517 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CFD")]
		[Address(RVA = "0x109E970", Offset = "0x109D970", VA = "0x18109E970")]
		private void OnDestroy()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002CFE RID: 11518 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CFE")]
		[Address(RVA = "0x109EE20", Offset = "0x109DE20", VA = "0x18109EE20")]
		public void OnEnable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002CFF RID: 11519 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002CFF")]
		[Address(RVA = "0x109ED20", Offset = "0x109DD20", VA = "0x18109ED20")]
		public void OnDisable()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D00 RID: 11520 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002D00")]
		[Address(RVA = "0x109F0A0", Offset = "0x109E0A0", VA = "0x18109F0A0")]
		private void UpdateIfNeeded(object sender, EventArgs e)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002D01 RID: 11521 RVA: 0x0006333C File Offset: 0x0006153C
		[Token(Token = "0x6002D01")]
		[Address(RVA = "0x109F410", Offset = "0x109E410", VA = "0x18109F410")]
		private void UpdateRigidbody(object sender, EventArgs e)
		{
			ObiRigidbody obiRigidbody = this.obiRigidbody;
			int num = 0;
			if (obiRigidbody != num)
			{
				this.obiRigidbody.UpdateVelocities();
			}
		}

		// Token: 0x06002D02 RID: 11522 RVA: 0x00063370 File Offset: 0x00061570
		[Token(Token = "0x6002D02")]
		[Address(RVA = "0x109F520", Offset = "0x109E520", VA = "0x18109F520")]
		protected ObiColliderBase()
		{
			HashSet<ObiSolver> hashSet = new HashSet();
			this.solvers = hashSet;
			base..ctor();
		}

		// Token: 0x06002D03 RID: 11523 RVA: 0x000633B0 File Offset: 0x000615B0
		// Note: this type is marked as 'beforefieldinit'.
		[Token(Token = "0x6002D03")]
		[Address(RVA = "0x109F4A0", Offset = "0x109E4A0", VA = "0x18109F4A0")]
		static ObiColliderBase()
		{
			/*
An exception occurred when decompiling this method (06002D03)

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: 0x04003608 RID: 13832
		[Token(Token = "0x4003608")]
		public static Dictionary<int, Component> idToCollider;

		// Token: 0x04003609 RID: 13833
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003609")]
		[HideInInspector]
		[SerializeField]
		private ObiCollisionMaterial material;

		// Token: 0x0400360A RID: 13834
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x400360A")]
		public int phase;

		// Token: 0x0400360B RID: 13835
		[FieldOffset(Offset = "0x24")]
		[Token(Token = "0x400360B")]
		public float thickness;

		// Token: 0x0400360C RID: 13836
		[FieldOffset(Offset = "0x28")]
		[Token(Token = "0x400360C")]
		[HideInInspector]
		[SerializeField]
		protected Component unityCollider;

		// Token: 0x0400360D RID: 13837
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x400360D")]
		protected IntPtr oniCollider = (IntPtr)((ulong)0L);

		// Token: 0x0400360E RID: 13838
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x400360E")]
		protected ObiRigidbody obiRigidbody;

		// Token: 0x0400360F RID: 13839
		[FieldOffset(Offset = "0x40")]
		[Token(Token = "0x400360F")]
		protected int currentLayer = (int)((ulong)4294967295L);

		// Token: 0x04003610 RID: 13840
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003610")]
		protected bool wasUnityColliderEnabled = true;

		// Token: 0x04003611 RID: 13841
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003611")]
		protected float oldPhase;

		// Token: 0x04003612 RID: 13842
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003612")]
		protected float oldThickness;

		// Token: 0x04003613 RID: 13843
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x4003613")]
		protected HashSet<ObiSolver> solvers;

		// Token: 0x04003614 RID: 13844
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x4003614")]
		protected ObiShapeTracker tracker;

		// Token: 0x04003615 RID: 13845
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x4003615")]
		protected Oni.Collider adaptor;
	}
}
