8#include "CoreMinimal.h"
9#include "Engine/StaticMesh.h"
11#include "Components/SplineComponent.h"
12#include "Components/SplineMeshComponent.h"
16#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION == 4
17#include "Engine/EngineTypes.h"
18#include "Engine/OverlapResult.h"
19#elif ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 4
20#include "Engine/EngineTypes.h"
22#include "Engine/OverlapResult.h"
26#include "SplineMeshedComponent.generated.h"
34 Category=
"YasiuSpline",
35 meta = ( DisplayName =
"Roll Method", ToolTip =
"Different methods to solve rotation along spline" )
66 Category=
"YasiuSpline",
67 meta = ( DisplayName =
"Mesh Stretching Method", ToolTip =
"Method fits meshes along spline" )
105USTRUCT(BlueprintType, Category=
"YasiuSpline")
110 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
114 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
122USTRUCT(BlueprintType, Category=
"YasiuSpline")
127 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
131 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
134 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
135 bool AlternateDirection = false;
138 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline")
144USTRUCT(BlueprintType, Category=
"YasiuSpline")
149 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
153 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
159USTRUCT(BlueprintType, Category=
"YasiuSpline")
160struct FSplineMeshed_PointData {
163 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
164 FVector3f location = FVector3f();
166 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
172USTRUCT(BlueprintType, Category=
"YasiuSpline")
180 :
Min(FVector(value, value, value)),
Max(FVector(value, value, value)) {};
184 :
Min(FVector(valMin, valMin, valMin)),
Max(FVector(valMax, valMax, valMax)) {};
188 :
Min(FVector(-amplitudeA, -amplitudeB, -amplitudeC)),
Max(FVector(amplitudeA, amplitudeB, amplitudeC)) {};
193 if (
Min.X != Number ||
Min.Y != Number ||
Min.Z != Number ) {
196 if (
Max.X != Number ||
Max.Y != Number ||
Max.Z != Number ) {
202 bool operator==(
const double& Number )
const
204 if ( (Min.X == Number && Min.Y == Number && Min.Z == Number) && (Max.X == Number && Max.Y == Number && Max.Z ==
212 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
216 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
222USTRUCT(BlueprintType, Category=
"YasiuSpline")
227 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
236 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
244 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
248 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
254USTRUCT(BlueprintType, Category=
"YasiuSpline")
259 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Collision")
260 TEnumAsByte<ECollisionEnabled::Type>
CollisionEnabled = ECollisionEnabled::Type::QueryAndPhysics;
263 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Collision")
267 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Collision")
273USTRUCT(BlueprintType, Category=
"YasiuSpline", meta=(DisplayName=
"Mesh spawn parameters"))
274struct FSplineMeshedSpawnParams {
277 FSplineMeshedSpawnParams() {};
281 const float& spacing,
282 const bool& deformMesh,
283 const ESplineMeshAxis::Type& forwardAxis,
289 const FTransform& MeshTransf,
290 const float& MeshSpacing,
291 const bool& DeformMesh,
294 ESplineMeshAxis::Type ForwardAxis
296 : StretchMethod(FitMethod), RotationMethod(RotateMethod), ForwardAxis(ForwardAxis), MeshSpacing(MeshSpacing),
297 DeformMesh(DeformMesh), MeshTransform(MeshTransf) {};
300 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Shape")
304 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Orientation")
308 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
309 TEnumAsByte<ESplineMeshAxis::Type>
ForwardAxis = ESplineMeshAxis::X;
313 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Spacing")
322 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Spacing")
326 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Shape")
333 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Shape")
337 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Shape")
341 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Orientation")
350 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Shape")
354 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Randomness")
358 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"Collision")
364USTRUCT(BlueprintType, Category=
"YasiuSpline")
369 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"Spline")
373 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"Spline")
377 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"Spline")
383USTRUCT(BlueprintType, Category=
"YasiuSpline")
390 params.ShowDebug =
false;
397 params.ShowDebug =
true;
402 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
406 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
410 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
415 float DebugSphereRadius = 1;
419 FVector DebugBoxSize{1, 1, 1};
427USTRUCT(BlueprintType, Blueprintable, Category=
"YasiuSpline")
435 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
445 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
450 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
451 TArray<TEnumAsByte<ECollisionChannel>>
ObjectTypes{ECollisionChannel::ECC_WorldStatic};
454 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
458 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
462 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
466 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
470 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
477 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
481 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
488 UPROPERTY(BlueprintReadOnly, Category=
"FunctionInternal")
496 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
500 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest")
504 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
508 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
512 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
516 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
520 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
523 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|QueryParams")
524 TArray<AActor*> IgnoredActors;
527 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"CollisionTest|Debug")
531 UPROPERTY(BlueprintReadOnly, Category=
"YasiuSpline")
537USTRUCT(BlueprintType, Category=
"YasiuSpline")
538struct FSplineMeshedOverlapResult {
541 FSplineMeshedOverlapResult() {}
543 FSplineMeshedOverlapResult( AActor* act )
548 FSplineMeshedOverlapResult(
const FOverlapResult& result )
550 Actor = result.GetActor();
556 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
560 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
564 UPROPERTY(BlueprintReadWrite, Category=
"YasiuSpline")
570USTRUCT(Blueprintable, BlueprintType, Category=
"YasiuSpline")
575 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
579 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
583 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
587 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
591 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
595 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
599 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
603 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
607 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
611 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
617 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
621 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
625 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
629 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
635UCLASS(BlueprintType, Blueprintable, Category=
"YasiuSpline", meta = ( BlueprintSpawnableComponent ))
636class YASIUSPLINEMESHED_API USplineMeshedComponent : public USplineComponent {
640 USplineMeshedComponent(
const FObjectInitializer& Initializer )
643 auto col = FLinearColor(0.01, 0.1, 0.35);
644 SetUnselectedSplineSegmentColor(col);
648 virtual void BeginPlay()
override;
650 virtual void DestroyComponent(
bool bPromoteChildren =
false )
override;
652 virtual void OnComponentDestroyed(
bool bDestroyingHierarchy )
override;
654 virtual void EndPlay(
const EEndPlayReason::Type reason )
override;
656 virtual void UninitializeComponent()
override;
659 virtual void PostEditChangeProperty(
struct FPropertyChangedEvent& PropertyChangedEvent )
override;
662 virtual void PostEditComponentMove(
bool bFinished )
override;
670 virtual void PreEditUndo()
override;
672 virtual void PostEditUndo()
override;
684 UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category=
"YasiuSpline")
688 virtual
void PlaceMeshesAlongSpline_Implementation( UStaticMesh* Mesh, const
FSplineMeshedSpawnParams SpawnParameters );
693 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
699 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline", BlueprintPure=false)
702 const UStaticMesh* Mesh,
722 UFUNCTION(BlueprintNativeEvent, Category=
"YasiuSpline")
724 const FVector& ForwardVec,
725 const FVector& UpVect,
727 const
float DistanceA,
728 const
float DistanceB,
730 USplineMeshComponent* RefMesh
743 virtual
void OnMeshSpawn_Implementation(
744 const FVector& ForwardVec,
746 const FVector& UpVect,
748 const
float DistanceA,
749 const
float DistanceB,
750 USplineMeshComponent* RefMesh
755 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
765 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
772 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
773 void GetMeshes( TArray<class USplineMeshComponent*>& OutArray ) const;
779 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
783 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
787 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
791 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
795 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline", SkipSerialization)
799 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline", SkipSerialization)
803 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=
"YasiuSpline", SkipSerialization)
807 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
811 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
815 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
821 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
826 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
827 void ChangeToSinus();
830 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
831 void ChangeToHelix();
834 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
839 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
844 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
855 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
862 UFUNCTION(BlueprintCallable, Category=
"SplineTools")
868 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
872 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
876 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
880 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
884 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
888 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
895 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
914 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline", BlueprintPure=
false)
925 void UpdateWithParent(
bool ForceUpdate = false );
931 bool DetectObjectsHelper(
953 UFUNCTION(BlueprintNativeEvent, Category=
"YasiuSpline")
957 const FVector& LocationIn,
958 const FQuat& RotationIn,
979 virtual
void DetectionFunction_Implementation(
982 const FVector& LocationIn,
983 const FQuat& RotationIn,
990 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
991 FVector
GetSideOffset( const FVector& Fwd, const FVector& Up,
float DistanceRight,
float AngleDeg ) const;
1001 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
1005 const TEnumAsByte<ESplineCoordinateSpace::Type>& CoordSpace = ESplineCoordinateSpace::World
1009 bool WasUpdated = true;
1012 UFUNCTION(BlueprintCallable, Category=
"YasiuSpline")
1015 const FVector& CurrentUp,
1016 const FVector& CurrentForward,
1017 const FVector& PrevUp,
1018 const FVector& UpParameter
1023 UPROPERTY(BlueprintReadOnly, Category=
"YasiuSpline")
1029 virtual
void MeshArrayReserve( const
int& amount );
1032 static FVector FindClosestUpVector( const FVector& previousUp, const FVector& currentForward );
1035 static FVector MatchVectors( const FVector& axis, FVector properOrientedVector, FVector splineVector );
1042USTRUCT(BlueprintType, Blueprintable, Category=
"YasiuSpline")
1047 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1051 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1055 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1059 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1063 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1069 UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(Category=
"SplineExtended"))
1075UCLASS(BlueprintType, Blueprintable, Category=
"YasiuSpline", meta = ( BlueprintSpawnableComponent ))
1084 UPROPERTY(BlueprintReadWrite, EditAnywhere, Category=
"YasiuSpline")
1090UCLASS(BlueprintType, Blueprintable, Category=
"YasiuSpline", meta = ( BlueprintSpawnableComponent ))
1098 virtual void OnMeshSpawn_Implementation(
1099 const FVector& forwardVec,
1100 const FVector& upVect,
1101 const int segmentID,
1102 const float distanceA,
1103 const float distanceB,
1104 USplineMeshComponent* refMesh
1110UCLASS(BlueprintType, Blueprintable, Category=
"YasiuSpline", meta = ( BlueprintSpawnableComponent ))
1118 virtual void OnMeshSpawn_Implementation(
1119 const FVector& forwardVec,
1120 const FVector& upVect,
1121 const int segmentID,
1122 const float distanceA,
1123 const float distanceB,
1124 USplineMeshComponent* refMesh
ESplineMeshStretching
Method that decides how to place meshes.
Definition SplineMeshedComponent.h:69
@ PipeStretching
Stretch meshes to make seamless connection at offset. (Can not use randomness).
Definition SplineMeshedComponent.h:83
@ StretchOnlyLast
Last mesh will stretch to fit to end.
Definition SplineMeshedComponent.h:74
@ ItemPerSegment
Places mesh object to fill single segment from point to point.
Definition SplineMeshedComponent.h:80
@ MinimalStretchOnAll
Fit segments from start to end. Applies minimal and equal stretch to all segments.
Definition SplineMeshedComponent.h:77
@ NoStretching
Only full meshes will be spawned.
Definition SplineMeshedComponent.h:71
ESplineRotateMode
Method that solved mesh rotation along spline.
Definition SplineMeshedComponent.h:37
@ DefaultFixed
(Same as Default) Fixes rare twist artifacts when mesh is spawn on opposite spline side....
Definition SplineMeshedComponent.h:52
@ SmoothRoll
Keep side faces aligned through whole spline smoothly. Good for vertical splines, but rotates more an...
Definition SplineMeshedComponent.h:57
@ ConstantRelative
Same UpVector for all meshes. Relative to component orientation (or owning actor).
Definition SplineMeshedComponent.h:42
@ ConstantAbsolute
Same UpVector for all meshes (World orientation).
Definition SplineMeshedComponent.h:39
@ Default
Gets spline's UpVector and copies it without modification. Good for horizontal splines.
Definition SplineMeshedComponent.h:47
Modified USplineMeshedComponent that spawns meshes in helix pattern.
Definition SplineMeshedComponent.h:1111
Modified USplineMeshedComponent that spawns meshes in zigzag/sinus pattern.
Definition SplineMeshedComponent.h:1091
Abstract class that uses bridge pattern.
Definition SplineMeshedComponent.h:1076
FSplineMeshed_ExtendedParams ExtendedSpline
Parameters used for customizing extended classes. Sinus and helix.
Definition SplineMeshedComponent.h:1085
void MakeSinus(const FSplineSinusParams &SinusParams)
Function that changes points to sinus.
void DetectionFunction(TArray< FSplineMeshedOverlapResult > &DetectedObjects, UWorld *World, const FVector &LocationIn, const FQuat &RotationIn, const FSplineDetectionTestParams &ParamsIn) const
Detection function's body, (can be customized), used by DetectObjectsAlongSpline. By default,...
FSplineSmoothParams TangentToolParams
Parameter used by editor commands.
Definition SplineMeshedComponent.h:804
bool DetectObjectsAlongSpline(TArray< FSplineMeshedOverlapResult > &DetectResults, FSplineDetectionTestParams DetectionParams) const
Detection function that iterates along spline and does multiple checks. Function evaluates shape of g...
static void ApplyParamsToMesh(const FYasiuSplineMeshParams ¶ms, USplineMeshComponent *Mesh)
Applies all parameters from struct to SplineMesh Object, without Update. Except ForwardDirection and ...
static void CopyMeshMaterials(const UMeshComponent *copyFrom, UMeshComponent *copyTo)
Copy materials between meshes.
void CustomTangents()
Function will adjust tangents of single point using TangentToolParams variable.
Definition SplineMeshedComponent.h:889
void GetMeshes(TArray< class USplineMeshComponent * > &OutArray) const
Returns Copy of array containing only valid SplineMesh objects.
void OnMeshSpawn(const FVector &ForwardVec, const FVector &UpVect, const int SegmentID, const float DistanceA, const float DistanceB, USplineMeshComponent *RefMesh)
Function that is triggered after placing each mesh with corresponding values.
void PlaceMeshesAlongSpline(UStaticMesh *Mesh, const FSplineMeshedSpawnParams SpawnParameters)
Spawn meshes along spline by given params. Override if you intend to clear/set variables before spawn...
int Num() const
Current amount of meshes stored (may count invalid).
Definition SplineMeshedComponent.h:756
void CustomTangentsAllPoints()
Function will adjust tangents of all spline points using TangentToolParams variable.
Definition SplineMeshedComponent.h:896
void Soft()
Function will adjust tangents of all points to make it look smooth.
Definition SplineMeshedComponent.h:877
void ExtraCurvy()
Function will adjust tangents of all points to make it look extra smooth and very curvy.
Definition SplineMeshedComponent.h:885
virtual void CopySplineAndMeshes(const USplineMeshedComponent *copyFrom)
Copy spline points, curve and mesh properties.
virtual void SetMaterialsByIndex(const TArray< UMaterialInterface * > &materials)
Applies materials from array to all meshes.
void SetSmoothnessAtPoint(int keyIndex, float smoothness=1.f, float ZRotationDeg=0.f)
Change single point to have given smoothness and rotation. Does not update actor!
FSplineHelixParams HelixToolParams
Parameters to create helix spline in editor.
Definition SplineMeshedComponent.h:800
void MakeHelix(const FSplineHelixParams &HelixParams)
Function that changes points to helix.
void OffsetAllPoints(const FVector &RelativeOffset)
Function used to move all spline points with given relative offset.
ASplineMeshActor * SpawnMeshStaticClone(const USplineMeshComponent *Mesh)
Spawns static actor in world and copies spline mesh properties.
TArray< TObjectPtr< USplineMeshComponent > > MeshesArray
Array of created SplineMeshes.
Definition SplineMeshedComponent.h:1024
void Smooth()
Function will set all points type to Curve (they auto update tangents).
FVector GetSideOffset(const FVector &Fwd, const FVector &Up, float DistanceRight, float AngleDeg) const
Calculate helix offset defined by forward Axis, Up axis and rotation Angle.
void ChangeMesh(TSoftObjectPtr< UStaticMesh > Mesh)
Change static mesh in all Objects. (Updates only mesh's tangents).
FVector VectorFrom2Points(float distanceA, float distanceB, const TEnumAsByte< ESplineCoordinateSpace::Type > &CoordSpace=ESplineCoordinateSpace::World) const
Get normalized vector between 2 points, points are clamped to spline length.
TArray< ASplineMeshActor * > CloneSplineToStaticActors()
clone of all meshes in spline and make them static object
FSplineSinusParams SinusToolParams
Parameters to create sinus spline in editor.
Definition SplineMeshedComponent.h:796
void Sharp()
Function will adjust tangents of all points to make it sharp.
Definition SplineMeshedComponent.h:873
void SetSmoothnessAtAllPoints(float smoothness=1.f, float ZRotationDeg=0.f)
Change spline all points to have desired params.
void GetMeshPositonsArray(TArray< FYasiuSplineMeshParams > &OutArray, const UStaticMesh *Mesh, const FSplineMeshedSpawnParams ¶msIn) const
Function that evaluates mesh position and tangent based on params passed in.
FVector CalculateSplineUpVector(ESplineRotateMode Mode, const FVector &CurrentUp, const FVector &CurrentForward, const FVector &PrevUp, const FVector &UpParameter) const
Function used to calculate UpVector from given vectors.
virtual void CopySplinePoints(const USplineMeshedComponent *copyFrom)
Copy spline points and curve.
Params for drawing collision checks.
Definition SplineMeshedComponent.h:384
bool ShowDebug
Show debug when true.
Definition SplineMeshedComponent.h:403
float DisplayTime
Render time of shape.
Definition SplineMeshedComponent.h:407
bool ShowEveryOverlap
False = Show only colliding boxes, True = shows every box with red or green color.
Definition SplineMeshedComponent.h:411
Params used for collision check along spline. Some variables are mirrored to match unreal engine's **...
Definition SplineMeshedComponent.h:428
bool CenterMesh
Should mesh be centered or use origin offset.
Definition SplineMeshedComponent.h:463
bool IgnoreBlocks
Used in C++, Whether to ignore blocking results.
Definition SplineMeshedComponent.h:513
bool SelfIgnore
Should collision test ignore self components.
Definition SplineMeshedComponent.h:467
ESplineRotateMode RotationMethod
Rotation method related to mesh spawn.
Definition SplineMeshedComponent.h:459
bool StopAtFirstCollision
Stop iterating at first valid collision.
Definition SplineMeshedComponent.h:478
FCollisionQueryParams GetQueryParams() const
Function to convert structure into FCollisionQueryParams.
bool FindInitialOverlaps
Used in C++, Whether we want to find out initial overlap or not. If true, it will return if this was ...
Definition SplineMeshedComponent.h:509
TSoftObjectPtr< UStaticMesh > TestMesh
Mesh used for collision test.
Definition SplineMeshedComponent.h:436
FVector LocationOffset
Temporary offset used for computing location on spline.
Definition SplineMeshedComponent.h:532
TArray< TEnumAsByte< ECollisionChannel > > ObjectTypes
List of collision channels for testing in USplineMeshedComponent::DetectObjectsAlongSpline.
Definition SplineMeshedComponent.h:451
FSplineDebugParams DebugParams
Debug parms used to show overlap boxes.
Definition SplineMeshedComponent.h:528
bool LastOverlapWithingSplineLimits
Compensates boundary dimension to not extend beyond spline point, otherwise half of mesh will extend....
Definition SplineMeshedComponent.h:501
bool FirstOverlapWithingSplineLimits
Compensates boundary dimension to not extend beyond spline point, otherwise half of mesh will extend....
Definition SplineMeshedComponent.h:497
bool IgnoreTouches
Used in C++, Whether to ignore touch/overlap results.
Definition SplineMeshedComponent.h:517
bool SkipNarrowPhase
Used in C++, Whether to skip narrow phase checks (only for overlaps).
Definition SplineMeshedComponent.h:521
FVector ShapeSize
Run time variable evaluated and passed to detection function Box Shape size, For Sphere X is size....
Definition SplineMeshedComponent.h:489
bool UseSphere
Use sphere instead of bounding box.
Definition SplineMeshedComponent.h:482
FTransform MeshTransform
Relative transform for collision check.
Definition SplineMeshedComponent.h:446
FVector UpVector
Up vector related to Constant rotation mode In RotationMethod.
Definition SplineMeshedComponent.h:471
bool TraceComplex
Used in C++, Whether we should trace against complex collision.
Definition SplineMeshedComponent.h:505
float StepDistance
Distance between collision checks (mesh size is ignored).
Definition SplineMeshedComponent.h:455
Parameters for helix.
Definition SplineMeshedComponent.h:123
float PeriodDistance
Distance in unreal units for whole cycle.
Definition SplineMeshedComponent.h:128
int Resolution
Number of points for 1 period.
Definition SplineMeshedComponent.h:139
float Amplitude
Helix Amplitude.
Definition SplineMeshedComponent.h:132
Parameters used to set simple collision on mesh.
Definition SplineMeshedComponent.h:255
TEnumAsByte< ECollisionChannel > CollisionType
Object collision channel.
Definition SplineMeshedComponent.h:264
TEnumAsByte< ECollisionEnabled::Type > CollisionEnabled
Should collision be enabled.
Definition SplineMeshedComponent.h:260
TEnumAsByte< ECollisionResponse > CollisionResponse
Object response to same channel only.
Definition SplineMeshedComponent.h:268
Collision results returned for use in BP.
Definition SplineMeshedComponent.h:538
AActor * Actor
Actor reference.
Definition SplineMeshedComponent.h:557
bool IsBlocking
Was test blocking or touch.
Definition SplineMeshedComponent.h:565
UPrimitiveComponent * Component
Component of colliding actor.
Definition SplineMeshedComponent.h:561
Parameters used to customize mesh spawn along spline.
Definition SplineMeshedComponent.h:274
bool FixSharpDeformations
Removes (tangents) of meshes that are spawned on very tight curves. (FixInvalidTangents must be enabl...
Definition SplineMeshedComponent.h:338
bool DeformMesh
Can meshes be deformed with tangents.
Definition SplineMeshedComponent.h:327
ESplineMeshStretching StretchMethod
How many meshes should be spawned along spline.
Definition SplineMeshedComponent.h:301
bool AddMeshSizeToSpacing
Size of mesh in spine direction will be added to spacing step.
Definition SplineMeshedComponent.h:323
FSplineMeshedSpawnParams(const float &spacing, const bool &deformMesh, const ESplineMeshAxis::Type &forwardAxis, const ESplineRotateMode &RotateMethod)
For Spaced non-deformed meshes.
Definition SplineMeshedComponent.h:280
TEnumAsByte< ESplineMeshAxis::Type > ForwardAxis
Axis of mesh to be aligned along spline.
Definition SplineMeshedComponent.h:309
FVector UpVector
Vector for use with "Constant" rotation mode, ESplineRotateMode.
Definition SplineMeshedComponent.h:342
float MeshSpacing
Spacing between meshes, Scaled with MeshTransform for easier use. see also AddMeshSizeToSpacing.
Definition SplineMeshedComponent.h:314
FSplineRandomness MeshRandomness
Values used for randomizing rotation and translation. Not used with Stretching=Pipes.
Definition SplineMeshedComponent.h:355
FTransform MeshTransform
Relative transform change.
Definition SplineMeshedComponent.h:351
FSplineMeshedCollision CollisionPreset
Collision parameters that are applied to each mesh.
Definition SplineMeshedComponent.h:359
bool FixInvalidTangents
Fix tangents that are perpendicular (prevents deforms that show mesh inside).
Definition SplineMeshedComponent.h:334
ESplineRotateMode RotationMethod
Method used for solving up vector.
Definition SplineMeshedComponent.h:305
Params used in subclasses USplineMeshedComponent_Extension.
Definition SplineMeshedComponent.h:1043
float Amplitude
How far from center does elements will be placed.
Definition SplineMeshedComponent.h:1052
bool RotateToShape
Rotate meshes to align with temp spline.
Definition SplineMeshedComponent.h:1064
bool UseAlternate
Generate alternate variant of function.
Definition SplineMeshedComponent.h:1060
float PhaseOffset
Phase offset in distance units.
Definition SplineMeshedComponent.h:1056
float PeriodDistance
Period over distance.
Definition SplineMeshedComponent.h:1048
bool UniformSize
Uniform size means all meshes are same size, but it can create gaps. This option works only with Rota...
Definition SplineMeshedComponent.h:1070
Symmetric spline point representation.
Definition SplineMeshedComponent.h:145
float rotation
Twist rotation for spline point.
Definition SplineMeshedComponent.h:154
float tangent
How sharp/straight is spline curve. 0 is sharp.
Definition SplineMeshedComponent.h:150
Params used for randomizing each mesh.
Definition SplineMeshedComponent.h:223
FVectorRange Translation
Translation relative to spline:
Definition SplineMeshedComponent.h:237
int seed
Seed that is feed into Squirrel13 RNG.
Definition SplineMeshedComponent.h:228
FVectorRange Scale
Random scale range.
Definition SplineMeshedComponent.h:249
FVectorRange Rotation
Random rotation.
Definition SplineMeshedComponent.h:245
Parameters for sinus.
Definition SplineMeshedComponent.h:106
float Amplitude
Sinus Amplitude.
Definition SplineMeshedComponent.h:115
float PeriodDistance
Distance in unreal units for whole cycle.
Definition SplineMeshedComponent.h:111
Struct used in editor tools to modify spline.
Definition SplineMeshedComponent.h:365
int pointIndex
Point index in spline.
Definition SplineMeshedComponent.h:370
float smoothness
How smooth is tangent, 0 straight line, 1 is smooth, 1+ is move curvy.
Definition SplineMeshedComponent.h:374
float rotationZ
Additional twist in Z axis.
Definition SplineMeshedComponent.h:378
Pair of 2 vectors representing Min and Max values of XYZ.
Definition SplineMeshedComponent.h:173
bool operator!=(const double &Number) const
Checks if any element in Min/Max is different than passed Number.
Definition SplineMeshedComponent.h:191
FVectorRange(float amplitudeA, float amplitudeB, float amplitudeC)
Constructor with 3 amplitudes, Min = -amplitude, Max = amplitude.
Definition SplineMeshedComponent.h:187
FVector Max
Vector of max values.
Definition SplineMeshedComponent.h:217
FVector Min
Vector of min values.
Definition SplineMeshedComponent.h:213
FVectorRange(float valMin, float valMax)
Constructor for same min and max values.
Definition SplineMeshedComponent.h:183
FVectorRange(float value)
Constructor Value = Min = Max.
Definition SplineMeshedComponent.h:179
SplineMesh parameters passed between functions.
Definition SplineMeshedComponent.h:571
FVector EndPos
End location of spline, in component space.
Definition SplineMeshedComponent.h:580
FVector2D EndScale
X and Y scale applied to mesh at end of spline.
Definition SplineMeshedComponent.h:596
float StartRoll
Roll around spline applied at start, in radians.
Definition SplineMeshedComponent.h:600
float SplineDistanceStart
Distance for me where it starts.
Definition SplineMeshedComponent.h:626
float SplineDistanceEnd
Distance for me where it ends.
Definition SplineMeshedComponent.h:630
FVector StartTangent
Start tangent of spline, in component space.
Definition SplineMeshedComponent.h:584
FVector UpVector
UpVector for that mesh.
Definition SplineMeshedComponent.h:622
FVector StartPos
Start location of spline, in component space.
Definition SplineMeshedComponent.h:576
FVector2D StartOffset
Starting offset of the mesh from the spline, in component space.
Definition SplineMeshedComponent.h:608
FVector EndTangent
End tangent of spline, in component space.
Definition SplineMeshedComponent.h:588
FTransform RelativeTransform
Calculated Transform relative to actor.
Definition SplineMeshedComponent.h:618
FVector2D EndOffset
Ending offset of the mesh from the spline, in component space.
Definition SplineMeshedComponent.h:612
FVector2D StartScale
X and Y scale applied to mesh at start of spline.
Definition SplineMeshedComponent.h:592
float EndRoll
Roll around spline applied at end, in radians.
Definition SplineMeshedComponent.h:604