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

This commit is contained in:
Mamadou Babaei
2026-02-24 13:16:34 +01:00
parent 23fe1a01b0
commit 6f88cdc075
3 changed files with 39 additions and 1 deletions
+5 -1
View File
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### [Unreleased]
### Added
- A new `FSGDebugVirtualHand::Draw()` overload has been added to allow visualizing `FSGDebugGizmoSettings` directly. This is used internally by the new `USGHandTrackerComponent` to visualize its `FXRHandTrackingState` if `bVisualize` is enabled.
### Fixed
- Fix some copyright notices with wrong copyright owner. These propably has happend during bulk replaces with class or struct names.
@@ -14,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- List existing SenseGlove components under `SenseGlove` `ClassGroup` inside Unreal's Blueprint Editor. This chagnes `ClassGroup` for `USGGrabComponent`, `USGTouchComponent`, `USGVirtualHandComponent`, and `USGWristTrackerComponent`.
- Force `USGVirtualHandComponent` and `USGWristTrackerComponent` to update their XR hand-tracking state when their handedness is updated.
- Force `USGVirtualHandComponent` and `USGWristTrackerComponent` to update their XR hand-tracking data when their handedness is updated.
- Bumped the SenseGlove Unreal Engine Marketplace Packager to `v0.6.1-85c5a6e`.
- Bumped the copyright years.
@@ -130,4 +130,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 */
@@ -59,6 +59,11 @@ public:
const UWorld* World,
const FXRHandTrackingState& HandTrackingState,
const FSGVirtualHandDebuggingSettings& Settings);
static void Draw(
const UWorld* World,
const FXRHandTrackingState& HandTrackingState,
const FSGDebugGizmoSettings& Settings);
#endif /* ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5 */
public: