AsyncTickPhysics icon indicating copy to clipboard operation
AsyncTickPhysics copied to clipboard

add ATP_GetSocketTransform?

Open ashtorak opened this issue 11 months ago • 1 comments

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();
}

ashtorak avatar Jan 23 '25 20:01 ashtorak

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.

ashtorak avatar Feb 03 '25 19:02 ashtorak