Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ProjectilePathSelector.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CK_UE.h"
6#include "ProjectilePathSelector.generated.h"
7
8class AActor;
10
11
12USTRUCT(BlueprintType)
13struct CK_UE_API FProjectilePathResult
14{
15 GENERATED_BODY()
16
17public:
18 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
19 FVector TargetLocation = FVector::ZeroVector;
20
21 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
22 FVector GroundLocation = FVector::ZeroVector;
23
24 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
25 float HeightAboveGround = 0.0f;
26
27 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
28 float PathAlpha = 0.0f;
29};
30
31
32USTRUCT(BlueprintType)
34{
35 GENERATED_BODY()
36
37public:
38 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
39 FVector TargetLocation = FVector::ZeroVector;
40
41 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
42 FVector ImpactPoint = FVector::ZeroVector;
43
44 UPROPERTY(BlueprintReadOnly, Category = "ProjectilePath")
45 float TargetDistance = 0.0f;
46};
47
48
49USTRUCT(BlueprintType)
51{
52 GENERATED_BODY()
53
54public:
55 bool ResolveImpactPoint(const AActor* RequestingActor, const FTargetSelectionResult& TargetResult, float MaxImpactDistance, float ImpactObstructionOffset, FWeaponRequestImpactResult& OutImpactResult) const;
56 bool ResolveLaunchPath(const AActor* RequestingActor, const FVector& ImpactPoint, float SpawnHeightAboveImpact, float SpawnLateralOffset, float SpawnForwardOffset, FVector& OutFrom, FVector& OutDirection) const;
57 bool ResolveTargetHeightLocation(const UObject* WorldContextObject, const FVector& PathStart, const FVector& PathEnd, float TargetHeight, FProjectilePathResult& OutResult) const;
58
59private:
60 float ClampDistanceByObstruction(const AActor* RequestingActor, const FVector& StartLocation, const FVector& Direction, float Distance, float ImpactObstructionOffset) const;
61 bool BSForHeight(const FVector& PathStart, const FVector& PathEnd, float TargetHeight, FProjectilePathResult& OutResult, float PreviousAlpha, float PreviousDelta, float CurrentAlpha, float CurrentDelta, bool& bValue) const;
62 bool EvaluateHeightAtAlpha(const FVector& PathStart, const FVector& PathEnd, float Alpha, float TargetHeight, FProjectilePathResult& OutResult) const;
63 bool FindGroundLocation(const FVector& PathLocation, FVector& OutGroundLocation) const;
64
65private:
66 float GroundTraceUpOffset = 1000.0f;
67 float GroundTraceDownDistance = 10000.0f;
68
69 int32 SegmentCount = 16;
70 int32 BinarySearchIterationCount = 12;
71
72private:
73 UPROPERTY(Transient)
74 mutable TObjectPtr<UWorld> CachedWorld;
75};
Definition ProjectilePathSelector.h:14
Definition ProjectilePathSelector.h:51
Definition TargetSelector.h:26
float TargetDistance
Definition TargetSelector.h:40
FVector TargetLocation
Definition TargetSelector.h:37
Definition ProjectilePathSelector.h:34