return when ensure statements fail
This commit is contained in:
@@ -44,18 +44,31 @@
|
||||
#include "SGDebug/SGDebugCube.h"
|
||||
#include "SGDebug/SGDebugGizmo.h"
|
||||
|
||||
void FSGDebugVirtualHand::Draw(const UWorld* World,
|
||||
const FXRMotionControllerData& MotionControllerData,
|
||||
const FSGVirtualHandDebuggingSettings& Settings)
|
||||
void FSGDebugVirtualHand::Draw(
|
||||
const UWorld* World,
|
||||
const FXRMotionControllerData& MotionControllerData,
|
||||
const FSGVirtualHandDebuggingSettings& Settings)
|
||||
{
|
||||
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||
TEXT("Invalid virtual hand drawing mode!"));
|
||||
if (!ensureAlwaysMsgf(
|
||||
Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||
TEXT("Invalid virtual hand drawing mode!")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ensureAlwaysMsgf(MotionControllerData.bValid,
|
||||
TEXT("Invalid motion controller data!"));
|
||||
if (!ensureAlwaysMsgf(
|
||||
MotionControllerData.bValid,
|
||||
TEXT("Invalid motion controller data!")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ensureAlwaysMsgf(MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(),
|
||||
TEXT("Mismatched motion controller data positions and rotations!"));
|
||||
if (!ensureAlwaysMsgf(
|
||||
MotionControllerData.HandKeyPositions.Num() == MotionControllerData.HandKeyRotations.Num(),
|
||||
TEXT("Mismatched motion controller data positions and rotations!")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (TArray<FVector>::SizeType HandKeyIndex = 0;
|
||||
HandKeyIndex < MotionControllerData.HandKeyPositions.Num(); ++HandKeyIndex)
|
||||
@@ -75,18 +88,31 @@ void FSGDebugVirtualHand::Draw(const UWorld* World,
|
||||
}
|
||||
|
||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
|
||||
void FSGDebugVirtualHand::Draw(const UWorld* World,
|
||||
const FXRHandTrackingState& HandTrackingState,
|
||||
const FSGVirtualHandDebuggingSettings& Settings)
|
||||
void FSGDebugVirtualHand::Draw(
|
||||
const UWorld* World,
|
||||
const FXRHandTrackingState& HandTrackingState,
|
||||
const FSGVirtualHandDebuggingSettings& Settings)
|
||||
{
|
||||
ensureAlwaysMsgf(Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||
TEXT("Invalid virtual hand drawing mode!"));
|
||||
if (!ensureAlwaysMsgf(
|
||||
Settings.DrawingMode != ESGDebugVirtualHandDrawingMode::None,
|
||||
TEXT("Invalid virtual hand drawing mode!")))
|
||||
{
|
||||
return;
|
||||
};
|
||||
|
||||
ensureAlwaysMsgf(HandTrackingState.bValid,
|
||||
TEXT("Invalid hand tracking state!"));
|
||||
if (!ensureAlwaysMsgf(
|
||||
HandTrackingState.bValid,
|
||||
TEXT("Invalid hand tracking state!")))
|
||||
{
|
||||
return;
|
||||
};
|
||||
|
||||
ensureAlwaysMsgf(HandTrackingState.HandKeyLocations.Num() == HandTrackingState.HandKeyRotations.Num(),
|
||||
TEXT("Mismatched hand tracking state locations and rotations!"));
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user