AsyncTickPhysics
AsyncTickPhysics copied to clipboard
add ATP_GetSocketTransform?
Would it make sense to add a function to get the socket transform like this below? I copied the code from GetTransform and just added the BoneName to GetInternalHandle(). I don't really know, what I'm doing, but it seems to work fine for me :D
FTransform UAsyncTickFunctions::ATP_GetSocketTransform(UPrimitiveComponent* Component, FName BoneName)
{
if (const Chaos::FRigidBodyHandle_Internal* RigidHandle = GetInternalHandle(Component, BoneName))
{
const Chaos::FRigidTransform3 WorldCOM = Chaos::FParticleUtilitiesGT::GetActorWorldTransform(RigidHandle);
return WorldCOM;
}
return Component ? Component->GetComponentTransform() : FTransform();
}
It seems to work only for bones though, not for actual sockets. Probably because they don't have physics handle? Should change the function name then maybe.