add a new overload to FSGDebugVirtualHand::Draw() to allow visualizing any FSGDebugGizmoSettings instance directly
This commit is contained in:
@@ -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 */
|
||||
Reference in New Issue
Block a user