using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x02000476 RID: 1142
	[Token(Token = "0x2000476")]
	[Serializable]
	public class IKMappingBone : IKMapping
	{
		// Token: 0x06002881 RID: 10369 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002881")]
		[Address(RVA = "0x17094A0", Offset = "0x17084A0", VA = "0x1817094A0", Slot = "4")]
		public override bool IsValid(IKSolver solver, ref string message)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002882 RID: 10370 RVA: 0x0005C0B8 File Offset: 0x0005A2B8
		[Token(Token = "0x6002882")]
		[Address(RVA = "0x17095B0", Offset = "0x17085B0", VA = "0x1817095B0")]
		public IKMappingBone()
		{
			this.maintainRotationWeight = 1f;
			IKMapping.BoneMap boneMap = new IKMapping.BoneMap();
			this.boneMap = boneMap;
			base..ctor();
		}

		// Token: 0x06002883 RID: 10371 RVA: 0x0005C0E4 File Offset: 0x0005A2E4
		[Token(Token = "0x6002883")]
		[Address(RVA = "0x1709620", Offset = "0x1708620", VA = "0x181709620")]
		public IKMappingBone(Transform bone)
		{
			/*
An exception occurred when decompiling this method (06002883)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void RootMotion.FinalIK.IKMappingBone::.ctor(UnityEngine.Transform)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:float32(IKMappingBone::maintainRotationWeight, ldloc:IKMappingBone(this), ldc.r4:float32(1)); 	stloc:BoneMap(var_0_10, newobj:BoneMap(BoneMap::.ctor)); 	stfld:BoneMap(IKMappingBone::boneMap, ldloc:IKMappingBone(this), ldloc:BoneMap(var_0_10)); 	call:void(object::.ctor, ldloc:IKMappingBone[exp:object](this)); 	stfld:Transform(IKMappingBone::bone, ldloc:IKMappingBone(this), ldloc:Transform(bone)); }; 
   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: 0x06002884 RID: 10372 RVA: 0x0005C118 File Offset: 0x0005A318
		[Token(Token = "0x6002884")]
		[Address(RVA = "0x1709560", Offset = "0x1708560", VA = "0x181709560")]
		public void StoreDefaultLocalState()
		{
			this.boneMap.StoreDefaultLocalState();
		}

		// Token: 0x06002885 RID: 10373 RVA: 0x0005C138 File Offset: 0x0005A338
		[Token(Token = "0x6002885")]
		[Address(RVA = "0x17093D0", Offset = "0x17083D0", VA = "0x1817093D0")]
		public void FixTransforms()
		{
			IKMapping.BoneMap boneMap = this.boneMap;
			int num = 0;
			boneMap.FixTransform(num != 0);
		}

		// Token: 0x06002886 RID: 10374 RVA: 0x0005C15C File Offset: 0x0005A35C
		[Token(Token = "0x6002886")]
		[Address(RVA = "0x1709400", Offset = "0x1708400", VA = "0x181709400", Slot = "5")]
		public override void Initiate(IKSolverFullBody solver)
		{
			IKMapping.BoneMap boneMap = this.boneMap;
			if (boneMap == 0)
			{
				IKMapping.BoneMap boneMap2 = new IKMapping.BoneMap();
				this.boneMap = boneMap2;
			}
			Transform transform = this.bone;
			boneMap.Initiate(transform, solver);
		}

		// Token: 0x06002887 RID: 10375 RVA: 0x0005C198 File Offset: 0x0005A398
		[Token(Token = "0x6002887")]
		[Address(RVA = "0x1709540", Offset = "0x1708540", VA = "0x181709540")]
		public void ReadPose()
		{
			this.boneMap.MaintainRotation();
		}

		// Token: 0x06002888 RID: 10376 RVA: 0x0005C1B8 File Offset: 0x0005A3B8
		[Token(Token = "0x6002888")]
		[Address(RVA = "0x1709580", Offset = "0x1708580", VA = "0x181709580")]
		public void WritePose(float solverWeight)
		{
			/*
An exception occurred when decompiling this method (06002888)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void RootMotion.FinalIK.IKMappingBone::WritePose(System.Single)

 ---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'length')
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 51
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 401
   at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 276
   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 112
   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: 0x04003251 RID: 12881
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4003251")]
		public Transform bone;

		// Token: 0x04003252 RID: 12882
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003252")]
		[Range(0f, 1f)]
		public float maintainRotationWeight;

		// Token: 0x04003253 RID: 12883
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003253")]
		private IKMapping.BoneMap boneMap;
	}
}
