Files
UnrealEngineUWP/Engine/Source/Runtime/NavigationSystem/Public/SplineNavModifierComponent.h
robert seiver 7e81d67809 Use an existing adaptive tessellation algorithm in BezierUtilities to subdivide the spline in SplineNavModifierComponent. This algorithm adapts to the curvature of the spline so that curvier spots get broken down into more linear segments for higher fidelity
#jira UE-202492
[REVIEW] [at]Mikko.Mononen
#rb mikko.mononen, aris.theophanidis

#changelist validated
#virtualized

[CL 31581781 by robert seiver in ue5-main branch]
2024-02-16 16:54:19 -05:00

46 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "NavModifierComponent.h"
#include "SplineNavModifierComponent.generated.h"
struct FNavigationRelevantData;
UENUM()
enum class ESubdivisionLOD
{
Low,
Medium,
High,
Ultra,
};
/**
* Assign a chosen NavArea in the vicinity of a spline
* This component must only be attached to an actor with a USplineComponent
*/
UCLASS(Blueprintable, Meta = (BlueprintSpawnableComponent), hidecategories = (Variable, Tags, Cooking, Collision), MInimalAPI)
class USplineNavModifierComponent : public UNavModifierComponent
{
GENERATED_BODY()
/** Width of the generated tube-shaped NavModifierVolume enclosing the spline */
UPROPERTY(EditAnywhere, Category = Navigation, Meta=(UIMin="10", ClampMin="10"))
double StrokeWidth = 500.0f;
/** Height of the generated tube-shaped nav modifier volume enclosing the spline, must be tall enough to pass through the desired surface beneath the spline */
UPROPERTY(EditAnywhere, Category = Navigation, Meta=(UIMin="10", ClampMin="10"))
double StrokeHeight = 500.0f;
/** Higher LOD will capture finer details in the spline */
UPROPERTY(EditAnywhere, Category = Navigation)
ESubdivisionLOD SubdivisionLOD = ESubdivisionLOD::Medium;
virtual void CalculateBounds() const override;
virtual void GetNavigationData(FNavigationRelevantData& Data) const override;
protected:
float GetSudivisionThreshold() const;
};