Files
NobetaSource/Cpp2IL/Assembly-CSharp/RootMotion/FinalIK/IKSolverFullBody.cs
2023-09-06 22:09:22 +02:00

479 lines
13 KiB
C#

using System;
using Cpp2IlInjected;
using UnityEngine;
namespace RootMotion.FinalIK
{
// Token: 0x02000435 RID: 1077
[Token(Token = "0x2000435")]
[Serializable]
public class IKSolverFullBody : IKSolver
{
// Token: 0x0600266F RID: 9839 RVA: 0x00055CF8 File Offset: 0x00053EF8
[Token(Token = "0x600266F")]
[Address(RVA = "0x166AEF0", Offset = "0x16696F0", VA = "0x18166AEF0")]
public IKEffector GetEffector(Transform t)
{
IKEffector[] array = this.effectors;
int num = 0;
if (num < array.Length)
{
bool flag = array[num].bone == t;
IKEffector[] array2 = this.effectors;
if (!flag)
{
num++;
}
return array2[num];
}
throw new NullReferenceException();
}
// Token: 0x06002670 RID: 9840 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6002670")]
[Address(RVA = "0x166AEA0", Offset = "0x16696A0", VA = "0x18166AEA0")]
public FBIKChain GetChain(Transform transform)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06002671 RID: 9841 RVA: 0x00055D48 File Offset: 0x00053F48
[Token(Token = "0x6002671")]
[Address(RVA = "0x166AD70", Offset = "0x1669570", VA = "0x18166AD70")]
public int GetChainIndex(Transform transform)
{
FBIKChain[] array = this.chain;
int num = 0;
int num2 = 0;
if (num2 < array.Length)
{
int num3 = 0;
IKSolver.Node[] nodes = this.chain[num].nodes;
if (num3 < nodes.Length)
{
if (nodes[num3].transform == transform)
{
return num;
}
num3++;
}
num++;
return num;
}
throw new NullReferenceException();
}
// Token: 0x06002672 RID: 9842 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6002672")]
[Address(RVA = "0x166B010", Offset = "0x1669810", VA = "0x18166B010")]
public IKSolver.Node GetNode(int chainIndex, int nodeIndex)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06002673 RID: 9843 RVA: 0x00055DB0 File Offset: 0x00053FB0
[Token(Token = "0x6002673")]
[Address(RVA = "0x166ACE0", Offset = "0x16694E0", VA = "0x18166ACE0")]
public void GetChainAndNodeIndexes(Transform transform, out int chainIndex, out int nodeIndex)
{
int chainIndex2 = this.GetChainIndex(transform);
chainIndex.m_value = chainIndex2;
if (chainIndex2 != -1)
{
int nodeIndex2 = this.chain[chainIndex2].GetNodeIndex(transform);
nodeIndex.m_value = nodeIndex2;
}
}
// Token: 0x06002674 RID: 9844 RVA: 0x00055DF0 File Offset: 0x00053FF0
[Token(Token = "0x6002674")]
[Address(RVA = "0x166B210", Offset = "0x1669A10", VA = "0x18166B210", Slot = "6")]
public override IKSolver.Point[] GetPoints()
{
IKSolver.Point[] array2;
int num5;
int num6;
IKSolver.Node[] nodes2;
do
{
FBIKChain[] array = this.chain;
int num = 0;
int num2 = 0;
int num3 = 0;
int length = array.Length;
if (num3 < length)
{
IKSolver.Node[] nodes = array[num2].nodes;
num2++;
}
array2 = new IKSolver.Point[num];
FBIKChain[] array3 = this.chain;
int num4 = 0;
num5 = 0;
if (num4 >= array3.Length)
{
return array2;
}
num6 = 0;
nodes2 = this.chain[num5].nodes;
if (num6 >= nodes2.Length)
{
goto IL_97;
}
}
while (nodes2[num6] != 0 && num6 == 0);
throw new IndexOutOfRangeException();
IL_97:
num5++;
return array2;
}
// Token: 0x06002675 RID: 9845 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6002675")]
[Address(RVA = "0x166B080", Offset = "0x1669880", VA = "0x18166B080", Slot = "7")]
public override IKSolver.Point GetPoint(Transform transform)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06002676 RID: 9846 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6002676")]
[Address(RVA = "0x166B3A0", Offset = "0x1669BA0", VA = "0x18166B3A0", Slot = "4")]
public override bool IsValid(ref string message)
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06002677 RID: 9847 RVA: 0x00055EA8 File Offset: 0x000540A8
[Token(Token = "0x6002677")]
[Address(RVA = "0x166C0F0", Offset = "0x166A8F0", VA = "0x18166C0F0", Slot = "9")]
public override void StoreDefaultLocalState()
{
this.spineMapping.StoreDefaultLocalState();
IKMappingLimb[] array = this.limbMappings;
int num = 0;
if (num < array.Length)
{
array[num].StoreDefaultLocalState();
IKMappingLimb[] array2 = this.limbMappings;
num++;
}
IKMappingBone[] array3 = this.boneMappings;
if (num < array3.Length)
{
array3[num].StoreDefaultLocalState();
IKMappingBone[] array4 = this.boneMappings;
num++;
while (array4 != 0)
{
}
}
IKSolver.UpdateDelegate onStoreDefaultLocalState = this.OnStoreDefaultLocalState;
if (onStoreDefaultLocalState != 0)
{
onStoreDefaultLocalState();
}
}
// Token: 0x06002678 RID: 9848 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x6002678")]
[Address(RVA = "0x166ABC0", Offset = "0x16693C0", VA = "0x18166ABC0", Slot = "8")]
public override void FixTransforms()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06002679 RID: 9849 RVA: 0x00055F30 File Offset: 0x00054130
[Token(Token = "0x6002679")]
[Address(RVA = "0x166B640", Offset = "0x1669E40", VA = "0x18166B640", Slot = "10")]
protected override void OnInitiate()
{
int num = 0;
FBIKChain[] array = this.chain;
if (num < array.Length)
{
array[num].Initiate(this);
FBIKChain[] array2 = this.chain;
num++;
}
IKEffector[] array3 = this.effectors;
int length = array3.Length;
if (num < length)
{
array3[num].Initiate(this);
num++;
}
this.spineMapping.Initiate(this);
IKMappingBone[] array4 = this.boneMappings;
int length2 = array4.Length;
if (num < length2)
{
array4[num].Initiate(this);
num++;
}
IKMappingLimb[] array5 = this.limbMappings;
int length3 = array5.Length;
if (num < length3)
{
array5[num].Initiate(this);
num++;
}
}
// Token: 0x0600267A RID: 9850 RVA: 0x00055FF0 File Offset: 0x000541F0
[Token(Token = "0x600267A")]
[Address(RVA = "0x166B810", Offset = "0x166A010", VA = "0x18166B810", Slot = "11")]
protected override void OnUpdate()
{
do
{
float ikpositionWeight = this.IKPositionWeight;
int num = 0;
IKEffector[] array2;
if (num < (int)ikpositionWeight)
{
if (this.chain.Length == 0)
{
break;
}
float num2 = Mathf.Clamp(ikpositionWeight, (float)num, 1f);
IKSolver.UpdateDelegate onPreRead = this.OnPreRead;
this.IKPositionWeight = num2;
if (onPreRead != 0)
{
onPreRead();
}
this.ReadPose();
IKSolver.UpdateDelegate onPreSolve = this.OnPreSolve;
if (onPreSolve != 0)
{
onPreSolve();
}
this.Solve();
IKSolver.UpdateDelegate onPostSolve = this.OnPostSolve;
if (onPostSolve != 0)
{
onPostSolve();
}
this.WritePose();
IKEffector[] array = this.effectors;
int num3 = 0;
if (num3 >= array.Length)
{
break;
}
array[num3].OnPostWrite();
array2 = this.effectors;
num3++;
}
IKEffector ikeffector = array2[9];
int num4 = 0;
if (num4 >= ikeffector.target)
{
break;
}
Vector3 zero = Vector3.zero;
num4++;
}
while (this.effectors != 0);
}
// Token: 0x0600267B RID: 9851 RVA: 0x000560E8 File Offset: 0x000542E8
[Token(Token = "0x600267B")]
[Address(RVA = "0x166B9C0", Offset = "0x166A1C0", VA = "0x18166B9C0", Slot = "12")]
protected virtual void ReadPose()
{
FBIKChain[] array = this.chain;
int num = 0;
if (num < array.Length)
{
FBIKChain fbikchain = array[num];
IKConstraintBend bendConstraint = fbikchain.bendConstraint;
if ((bendConstraint.<initiated>k__BackingField ? 1 : 0) != num)
{
IKSolver.Node[] nodes = fbikchain.nodes;
float ikpositionWeight = this.IKPositionWeight;
Transform transform = nodes[2].transform;
float positionWeight = this.GetEffector(transform).positionWeight;
bendConstraint.LimitBend(ikpositionWeight, positionWeight);
}
num++;
}
IKEffector[] array2 = this.effectors;
if (num < array2.Length)
{
array2[num].ResetOffset(this);
IKEffector[] array3 = this.effectors;
num++;
while (array3 != 0)
{
}
}
if (num < array2.Length)
{
array2[num].OnPreSolve(this);
IKEffector[] array4 = this.effectors;
num++;
while (array4 != 0)
{
}
}
FBIKChain[] array5 = this.chain;
if (num < array5.Length)
{
FBIKChain fbikchain2 = array5[num];
bool flag = this.iterations > num;
fbikchain2.ReadPose(this, flag);
FBIKChain[] array6 = this.chain;
num++;
while (array6 != 0)
{
}
}
if (this.iterations > num)
{
this.spineMapping.ReadPose();
IKMappingBone[] array7 = this.boneMappings;
if (num < array7.Length)
{
array7[num].ReadPose();
IKMappingBone[] array8 = this.boneMappings;
num++;
while (array8 != 0)
{
}
}
}
IKMappingLimb[] array9 = this.limbMappings;
if (num < array9.Length)
{
array9[num].ReadPose();
IKMappingLimb[] array10 = this.limbMappings;
num++;
while (array10 != 0)
{
}
}
}
// Token: 0x0600267C RID: 9852 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600267C")]
[Address(RVA = "0x166BD10", Offset = "0x166A510", VA = "0x18166BD10", Slot = "13")]
protected virtual void Solve()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600267D RID: 9853 RVA: 0x00056274 File Offset: 0x00054474
[Token(Token = "0x600267D")]
[Address(RVA = "0x166AB70", Offset = "0x1669370", VA = "0x18166AB70", Slot = "14")]
protected virtual void ApplyBendConstraints()
{
this.chain[0].SolveTrigonometric(this, true);
}
// Token: 0x0600267E RID: 9854 RVA: 0x000020D3 File Offset: 0x000002D3
[Token(Token = "0x600267E")]
[Address(RVA = "0x166C200", Offset = "0x166AA00", VA = "0x18166C200", Slot = "15")]
protected virtual void WritePose()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x0600267F RID: 9855 RVA: 0x0005629C File Offset: 0x0005449C
[Token(Token = "0x600267F")]
[Address(RVA = "0x166C330", Offset = "0x166AB30", VA = "0x18166C330")]
public IKSolverFullBody()
{
FBIKChain[] array = new FBIKChain[0];
this.chain = array;
IKEffector[] array2 = new IKEffector[0];
this.effectors = array2;
IKMappingSpine ikmappingSpine = new IKMappingSpine();
this.spineMapping = ikmappingSpine;
IKMappingBone[] array3 = new IKMappingBone[0];
this.boneMappings = array3;
IKMappingLimb[] array4 = new IKMappingLimb[0];
this.limbMappings = array4;
this.FABRIKPass = true;
base..ctor();
}
// Token: 0x04002FF8 RID: 12280
[FieldOffset(Offset = "0x58")]
[Token(Token = "0x4002FF8")]
[Range(0f, 10f)]
public int iterations = (int)((ulong)4L);
// Token: 0x04002FF9 RID: 12281
[FieldOffset(Offset = "0x60")]
[Token(Token = "0x4002FF9")]
public FBIKChain[] chain;
// Token: 0x04002FFA RID: 12282
[FieldOffset(Offset = "0x68")]
[Token(Token = "0x4002FFA")]
public IKEffector[] effectors;
// Token: 0x04002FFB RID: 12283
[FieldOffset(Offset = "0x70")]
[Token(Token = "0x4002FFB")]
public IKMappingSpine spineMapping;
// Token: 0x04002FFC RID: 12284
[FieldOffset(Offset = "0x78")]
[Token(Token = "0x4002FFC")]
public IKMappingBone[] boneMappings;
// Token: 0x04002FFD RID: 12285
[FieldOffset(Offset = "0x80")]
[Token(Token = "0x4002FFD")]
public IKMappingLimb[] limbMappings;
// Token: 0x04002FFE RID: 12286
[FieldOffset(Offset = "0x88")]
[Token(Token = "0x4002FFE")]
public bool FABRIKPass;
// Token: 0x04002FFF RID: 12287
[FieldOffset(Offset = "0x90")]
[Token(Token = "0x4002FFF")]
public IKSolver.UpdateDelegate OnPreRead;
// Token: 0x04003000 RID: 12288
[FieldOffset(Offset = "0x98")]
[Token(Token = "0x4003000")]
public IKSolver.UpdateDelegate OnPreSolve;
// Token: 0x04003001 RID: 12289
[FieldOffset(Offset = "0xA0")]
[Token(Token = "0x4003001")]
public IKSolver.IterationDelegate OnPreIteration;
// Token: 0x04003002 RID: 12290
[FieldOffset(Offset = "0xA8")]
[Token(Token = "0x4003002")]
public IKSolver.IterationDelegate OnPostIteration;
// Token: 0x04003003 RID: 12291
[FieldOffset(Offset = "0xB0")]
[Token(Token = "0x4003003")]
public IKSolver.UpdateDelegate OnPreBend;
// Token: 0x04003004 RID: 12292
[FieldOffset(Offset = "0xB8")]
[Token(Token = "0x4003004")]
public IKSolver.UpdateDelegate OnPostSolve;
// Token: 0x04003005 RID: 12293
[FieldOffset(Offset = "0xC0")]
[Token(Token = "0x4003005")]
public IKSolver.UpdateDelegate OnStoreDefaultLocalState;
// Token: 0x04003006 RID: 12294
[FieldOffset(Offset = "0xC8")]
[Token(Token = "0x4003006")]
public IKSolver.UpdateDelegate OnFixTransforms;
}
}