In the first set of code, UpperArmsDistance appears to be the distance from the shoulder center to the distinct shoulder:
|
Settings.ArmLength = (Calibration.Height / 2.0f) - Calibration.UpperArmsDistance; |
But in the distinct shoulder rotation solver, there is a divide by two on the UpperArmsDistance. Indicating in this spot that it is meant to indicate the distance between the distinct shoulders, not the distance from shoulder center to distinct shoulder:
|
const FVector InitialUpperArmTranslation = FVector::RightVector * Settings.UpperArmsDistance / (2.f * Sign); |
This is likely throwing off your shoulder rotation solve. To fix this, either the ArmLength should be calculated as:
Settings.ArmLength = (Calibration.Height - Calibration.UpperArmsDistance) / 2.0f;
OR the divide by two should be removed:
const FVector InitialUpperArmTranslation = FVector::RightVector * Settings.UpperArmsDistance * Sign;
In the first set of code, UpperArmsDistance appears to be the distance from the shoulder center to the distinct shoulder:
UBIKSolver/Source/UBIKRuntime/Private/UBIK.cpp
Line 11 in acc72b6
But in the distinct shoulder rotation solver, there is a divide by two on the UpperArmsDistance. Indicating in this spot that it is meant to indicate the distance between the distinct shoulders, not the distance from shoulder center to distinct shoulder:
UBIKSolver/Source/UBIKRuntime/Private/AnimNode_UBIKSolver.cpp
Line 421 in acc72b6
This is likely throwing off your shoulder rotation solve. To fix this, either the ArmLength should be calculated as:
Settings.ArmLength = (Calibration.Height - Calibration.UpperArmsDistance) / 2.0f;OR the divide by two should be removed:
const FVector InitialUpperArmTranslation = FVector::RightVector * Settings.UpperArmsDistance * Sign;