Working on positionable crosshair

This commit is contained in:
2025-01-07 18:46:40 -05:00
parent e5e39fc02d
commit cd3e78a206
91 changed files with 326 additions and 169 deletions

View File

@@ -3,10 +3,37 @@
#pragma once
#include "CoreMinimal.h"
#include "Kismet/KismetSystemLibrary.h"
#include "UtilityLibrary.generated.h"
class UEnhancedInputLocalPlayerSubsystem;
USTRUCT(BlueprintType)
struct INTEGRATION_API FlxTraceStartTraceEnd
{
GENERATED_BODY()
UPROPERTY(EditAnywhere)
FVector TraceStart;
UPROPERTY(EditAnywhere)
FVector TraceEnd;
};
UENUM(BlueprintType)
enum class EMouseSpecificationType : uint8
{
// Automatically get the mouse position from the player controller. ManualMouseXY should be left blank.
GetMouseAutomatically,
// Specify the mouse position in pixels.
SpecifyMouseInPixels,
// Specify the mouse position as float from zero to one.
SpecifyMouseAsZeroToOne,
};
/**
*
* UlxUtilityLibrary is for functions that are aren't particularly luprex-specific,
@@ -47,4 +74,23 @@ public:
// enhanced input subsystem, return nullptr.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="Player Controller|Local Player Subsystems")
static UEnhancedInputLocalPlayerSubsystem *GetEnhancedInputLocalPlayerSubsystem(AController *Controller);
// // Do a Line Trace by Channel for each start-and-end pair, then return the closest hit result of all.
// UFUNCTION(BlueprintCallable, Category="Collision", meta=(bIgnoreReferenceActor="true", AutoCreateRefTerm="ActorsToIgnore,Offset", DisplayName="Line Trace Multiple Lines by Channel", AdvancedDisplay="TraceColor,TraceHitColor,DrawTime", Keywords="raycast"))
// static bool LineTraceMultipleLines(const AActor* ReferenceActor, const FVector &Offset,
// const TArray<FlxTraceStartTraceEnd> &TraceStartAndTraceEnd, ETraceTypeQuery TraceChannel,
// bool bTraceComplex, const TArray<AActor*>& ActorsToIgnore, EDrawDebugTrace::Type DrawDebugType, FHitResult& OutHit, bool bIgnoreReferenceActor,
// FLinearColor TraceColor = FLinearColor::Red, FLinearColor TraceHitColor = FLinearColor::Green, float DrawTime = 5.0f);
// Do a Line Trace to find the actor that the mouse is pointing at.
//
// If you have some crosshairs in the viewport, then you can find the
// object under the crosshairs by specifying the crosshairs XY as the
// ManualMouseXY.
//
UFUNCTION(BlueprintCallable, Category="Collision", meta=(AutoCreateRefTerm="ActorsToIgnore", Keywords="raycast"))
static bool LineTraceThroughMousePointer(const APlayerController* PlayerController,
EMouseSpecificationType MouseSpecification, FVector2D ManualMouseXY, double MaxDistanceFromCamera,
ETraceTypeQuery TraceChannel, bool bTraceComplex, EDrawDebugTrace::Type DrawDebugType, bool bIgnorePlayerPawn,
const TArray<AActor*>& ActorsToIgnore, AActor *& Actor, FHitResult& HitResult);
};