I have a vector I would like to transform from a bone space to world space in my TickComponent Method. I am trying it thusly:
int32 boneIndex = SkeletalMesh->GetBoneIndex(Airfoil.BoneName);
FTransform boneTransform = SkeletalMesh->GetBoneTransform(boneIndex);
FVector worldAirfoilNormal = boneTransform.TransformPosition(Airfoil.BoneAirfoilNormal);
But, even though it appears I am getting a valid boneIndex (4 in this case), the vector does not seem to transform when I rotate the bone, implying I am getting an identity transform.
Do I need to use the other overload of the method:
const FTransform & LocalToWorld
If so, should I be passing the UpdatedComponent->GetComponentTransform() as the FTransform arg?
Or, is there a better way to transform from bone to world space?
All blueprint function nodes (with “f” icon) are bindings of real functions in C++, they usally have same name but without spaces ofcorse, there few exception as you can set custom name for blueprint node, but when you use name in search of API refrence it should find it.
TransformFromBoneSpace() that you use in blueprint is part of USkinnedMeshComponent which USkeletalMeshComponent inhered from, so that function should be accessible to you
Thank you. Just learning my way around the docs, missed that one.
I was able to get better behavior with
FTransform boneTransform = SkeletalMesh->GetSocketTransform(Airfoil.BoneName);
FVector worldTestPoint = boneTransform.TransformPosition(Airfoil.LocalCenterOfLift);
FVector worldAirfoilNormal = boneTransform.TransformVector(Airfoil.BoneAirfoilNormal);
Note the use of both TransformPosition and TransformVector.