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