diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp index 76a851fe..89ceed29 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp @@ -117,11 +117,11 @@ USGWristTrackerComponent::USGWristTrackerComponent(const FObjectInitializer& Obj bOverridePluginWristTrackingDebugSettings = false; bDrawWristTrackerDebugGizmo = false; WristTrackerDebugGizmoSettings = FSGDebugGizmoSettings( - 4.0f, 1.0f, - FColor(1.0f, 0.0f, 0.0f, 1.0f), - FColor(0.0f, 1.0f, 0.0f, 1.0f), - FColor(0.0f, 0.0f, 1.0f, 1.0f), - false, 1.1f, 0 + 4.0f, 1.0f, + FColor(1.0f, 0.0f, 0.0f, 1.0f), + FColor(0.0f, 1.0f, 0.0f, 1.0f), + FColor(0.0f, 0.0f, 1.0f, 1.0f), + false, 1.1f, 0 ); bDrawWristTrackerDebugGizmo = false; @@ -539,11 +539,7 @@ void USGWristTrackerComponent::FImpl::DrawDebugGizmo() const FRotator& Rotation{Owner->GetComponentRotation()}; const FSGDebugGizmoSettings& DebugGizmoSettings{Owner->GetWristTrackerDebugGizmoSettings()}; - FSGDebugGizmo::Draw( - World, Location, Rotation, - DebugGizmoSettings.Length, DebugGizmoSettings.Thickness, - DebugGizmoSettings.XAxisColor, DebugGizmoSettings.YAxisColor, DebugGizmoSettings.ZAxisColor, - DebugGizmoSettings.bPersistentLines, DebugGizmoSettings.LifeTimeModifier, DebugGizmoSettings.DepthPriority); + FSGDebugGizmo::Draw(World, Location, Rotation, DebugGizmoSettings); } void USGWristTrackerComponent::FImplDeleter::operator()(const FImpl* P) const diff --git a/Source/SenseGloveDebug/Private/SGDebug/SGDebugGizmo.cpp b/Source/SenseGloveDebug/Private/SGDebug/SGDebugGizmo.cpp index a718006e..045e979e 100644 --- a/Source/SenseGloveDebug/Private/SGDebug/SGDebugGizmo.cpp +++ b/Source/SenseGloveDebug/Private/SGDebug/SGDebugGizmo.cpp @@ -41,23 +41,20 @@ #include "Math/Rotator.h" #include "Math/Vector.h" -#include "SGLog/SGLog.h" - -void FSGDebugGizmo::Draw( - const UWorld* World, - const FVector& Location, const FRotator& Rotation, - const float Length, const float Thickness, - const FColor& XAxisColor, const FColor& YAxisColor, const FColor& ZAxisColor, - const bool bPersistentLines, const float LifeTimeModifier, const uint8 DepthPriority) +void FSGDebugGizmo::Draw(const UWorld* World, const FVector& Location, const FRotator& Rotation, + const FSGDebugGizmoSettings& Settings) { - const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * LifeTimeModifier; + const float LifeTime = UGameplayStatics::GetWorldDeltaSeconds(World) * Settings.LifeTimeModifier; - const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Length, 0.0f, 0.0f))); - DrawDebugLine(World, Location, XAxisLineEnd, XAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness); + const FVector XAxisLineEnd(Location + Rotation.RotateVector(FVector(Settings.Length, 0.0f, 0.0f))); + DrawDebugLine(World, Location, XAxisLineEnd, + Settings.XAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness); - const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Length, 0.0f})); - DrawDebugLine(World, Location, YAxisLineEnd, YAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness); + const FVector YAxisLineEnd(Location + Rotation.RotateVector(FVector{0.0f, Settings.Length, 0.0f})); + DrawDebugLine(World, Location, YAxisLineEnd, + Settings.YAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness); - const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Length})}; - DrawDebugLine(World, Location, ZAxisLineEnd, ZAxisColor, bPersistentLines, LifeTime, DepthPriority, Thickness); + const FVector ZAxisLineEnd{Location + Rotation.RotateVector(FVector{0.0f, 0.0f, Settings.Length})}; + DrawDebugLine(World, Location, ZAxisLineEnd, + Settings.ZAxisColor, Settings.bPersistentLines, LifeTime, Settings.DepthPriority, Settings.Thickness); } \ No newline at end of file diff --git a/Source/SenseGloveDebug/Public/SGDebug/SGDebugGizmo.h b/Source/SenseGloveDebug/Public/SGDebug/SGDebugGizmo.h index 1343c17f..f626279d 100644 --- a/Source/SenseGloveDebug/Public/SGDebug/SGDebugGizmo.h +++ b/Source/SenseGloveDebug/Public/SGDebug/SGDebugGizmo.h @@ -35,20 +35,15 @@ #pragma once +#include "SGSettings/SGDebugGizmoSettings.h" + class SENSEGLOVEDEBUG_API FSGDebugGizmo final { public: static void Draw( const UWorld* World, const FVector& Location, const FRotator& Rotation, - float Length = 1.0f, - float Thickness = 1.0f, - const FColor& XAxisColor = FColor(1.0f, 0.0f, 0.0f, 1.0f), - const FColor& YAxisColor = FColor(0.0f, 1.0f, 0.0f, 1.0f), - const FColor& ZAxisColor = FColor(0.0f, 0.0f, 1.0f, 1.0f), - bool bPersistentLines = false, - float LifeTimeModifier = 1.1f, - uint8 DepthPriority = 0); + const FSGDebugGizmoSettings& Settings); public: FSGDebugGizmo() = delete; diff --git a/Source/SenseGloveDebug/SenseGloveDebug.Build.cs b/Source/SenseGloveDebug/SenseGloveDebug.Build.cs index c616d541..860124df 100644 --- a/Source/SenseGloveDebug/SenseGloveDebug.Build.cs +++ b/Source/SenseGloveDebug/SenseGloveDebug.Build.cs @@ -55,6 +55,7 @@ public class SenseGloveDebug : ModuleRules "CoreUObject", "Engine", "SenseGloveLog", + "SenseGloveSettings", } ); }