add a new overload to FSGDebugVirtualHand::Draw() to allow visualizing any FSGDebugGizmoSettings instance directly

This commit is contained in:
Mamadou Babaei
2026-02-24 10:42:41 +01:00
parent cbd7baa7bb
commit c4952f900d
3 changed files with 39 additions and 1 deletions
@@ -87,4 +87,33 @@ void FSGDebugVirtualHand::Draw(
}
}
}
void FSGDebugVirtualHand::Draw(
const UWorld* World,
const FXRHandTrackingState& HandTrackingState,
const FSGDebugGizmoSettings& Settings)
{
if (!ensureAlwaysMsgf(
HandTrackingState.bValid,
TEXT("Invalid hand tracking state!")))
{
return;
};
if (!ensureAlwaysMsgf(
HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
TEXT("Mismatched hand tracking state locations and rotations!")))
{
return;
};
for (TArray<FVector>::SizeType HandKeyIndex = 0;
HandKeyIndex < HandTrackingState.HandKeyLocations.Num(); ++HandKeyIndex)
{
const FVector& HandKeyLocation{HandTrackingState.HandKeyLocations[HandKeyIndex]};
const FQuat& HandKeyRotation{HandTrackingState.HandKeyRotations[HandKeyIndex]};
FSGDebugGizmo::Draw(World, HandKeyLocation, HandKeyRotation, Settings);
}
}
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */