using System;
using Cpp2IlInjected;
using UnityEngine;

namespace RootMotion.FinalIK
{
	// Token: 0x0200041E RID: 1054
	[Token(Token = "0x200041E")]
	[Serializable]
	public class IKMappingBone : IKMapping
	{
		// Token: 0x060025B8 RID: 9656 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x60025B8")]
		[Address(RVA = "0x1182DD0", Offset = "0x1181BD0", VA = "0x181182DD0", 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: 0x060025B9 RID: 9657 RVA: 0x00054D5C File Offset: 0x00052F5C
		[Token(Token = "0x60025B9")]
		[Address(RVA = "0x1182EE0", Offset = "0x1181CE0", VA = "0x181182EE0")]
		public IKMappingBone()
		{
			this.maintainRotationWeight = 1f;
			IKMapping.BoneMap boneMap = new IKMapping.BoneMap();
			this.boneMap = boneMap;
			base..ctor();
		}

		// Token: 0x060025BA RID: 9658 RVA: 0x00054D88 File Offset: 0x00052F88
		[Token(Token = "0x60025BA")]
		[Address(RVA = "0x1182F50", Offset = "0x1181D50", VA = "0x181182F50")]
		public IKMappingBone(Transform bone)
		{
			/*
An exception occurred when decompiling this method (060025BA)

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: 0x060025BB RID: 9659 RVA: 0x00054DBC File Offset: 0x00052FBC
		[Token(Token = "0x60025BB")]
		[Address(RVA = "0x1182E90", Offset = "0x1181C90", VA = "0x181182E90")]
		public void StoreDefaultLocalState()
		{
			this.boneMap.StoreDefaultLocalState();
		}

		// Token: 0x060025BC RID: 9660 RVA: 0x00054DDC File Offset: 0x00052FDC
		[Token(Token = "0x60025BC")]
		[Address(RVA = "0x1182D00", Offset = "0x1181B00", VA = "0x181182D00")]
		public void FixTransforms()
		{
			IKMapping.BoneMap boneMap = this.boneMap;
			int num = 0;
			boneMap.FixTransform(num != 0);
		}

		// Token: 0x060025BD RID: 9661 RVA: 0x00054E00 File Offset: 0x00053000
		[Token(Token = "0x60025BD")]
		[Address(RVA = "0x1182D30", Offset = "0x1181B30", VA = "0x181182D30", 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: 0x060025BE RID: 9662 RVA: 0x00054E3C File Offset: 0x0005303C
		[Token(Token = "0x60025BE")]
		[Address(RVA = "0x1182E70", Offset = "0x1181C70", VA = "0x181182E70")]
		public void ReadPose()
		{
			this.boneMap.MaintainRotation();
		}

		// Token: 0x060025BF RID: 9663 RVA: 0x00054E5C File Offset: 0x0005305C
		[Token(Token = "0x60025BF")]
		[Address(RVA = "0x1182EB0", Offset = "0x1181CB0", VA = "0x181182EB0")]
		public void WritePose(float solverWeight)
		{
			/*
An exception occurred when decompiling this method (060025BF)

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: 0x04002F67 RID: 12135
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x4002F67")]
		public Transform bone;

		// Token: 0x04002F68 RID: 12136
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4002F68")]
		[Range(0f, 1f)]
		public float maintainRotationWeight;

		// Token: 0x04002F69 RID: 12137
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4002F69")]
		private IKMapping.BoneMap boneMap;
	}
}
