Section 2.9. rdInstBase- Splines

// [rdInst v1.35] Splits the Spline into X subsplines
TArray<AActor*> rdSplitSplineInto(AActor* actor,USplineComponent* spline,int32 num,bool callBPfunctions=false);

// [rdInst v1.35] Get the Spline Points Position
void rdGetSplinePointPosition(int32 point,FVector& loc,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Position
TArray<AActor*> rdSetSplinePointPosition(int32 point,const FVector& loc,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Rotation
void rdGetSplinePointRotation(int32 point,FRotator& rot,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Rotation
TArray<AActor*> rdSetSplinePointRotation(int32 point,const FRotator& rot,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Scale
void rdGetSplinePointScale(int32 point,FVector& scale,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr);

// [rdInst v1.35] Set the Spline Points Scale
TArray<AActor*> rdSetSplinePointScale(int32 point,const FVector& scale,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,bool updateSpline=true);

// [rdInst v1.35] Get the Spline Points Tangent
void rdGetSplinePointTangent(int32 point,FVector& leaveTangent,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local);

// [rdInst v1.35] Set the Spline Points Tangent
TArray<AActor*> rdSetSplinePointTangent(int32 point,const FVector& leaveTangent,const TArray<AActor*>& subsplines,const AActor* splineActor=nullptr,const ESplineCoordinateSpace::Type cordSpace=ESplineCoordinateSpace::Local,bool updateSpline=true);

// [rdInst v1.35] Gets the SubSpline from the point
AActor* rdGetSubSplineAtPoint(int32 point,const TArray<AActor*>& subsplines,int32& subPoint);

// [rdInst v1.35] Finds the closest point on a SubSpline from the location
AActor* rdFindClosestSplinePoint(const FVector& loc,const TArray<AActor*>& subsplines,int32& localPoint,int32& overallPoint,float& distance,bool& found);

// [rdInst v1.35] Copy the Spline data from one to another
void rdCopySpline(USplineComponent* spline1,USplineComponent* spline2,int32 start,int32 end);
	
// [rdInst v1.35] Trim the Spline Points
void rdTrimSpline(USplineComponent* spline,int32 start,int32 len);

// [rdInst v1.35] Joins the Splines into one
void rdJoinSplines(AActor* actor,bool callBPfunctions=false);

// [rdInst v1.35] Joins the SubSplines attached to the actor into the actors spline
void rdMergeActorsSubSplines(AActor* actor,bool callBPfunctions=false);

// [rdInst v1.35] Populate the Spline with SplineMeshComponents from a single mesh
int32 rdPopulateSplineFast(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,UStaticMesh* mesh,const FTransform offset=FTransform(),float gap=0.0f,UMaterialInterface* mat=nullptr,const FVector scale=FVector(1,1,1),const TEnumAsByte<ESplineMeshAxis::Type> axis=ESplineMeshAxis::X,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Populate the Spline with SplineMeshComponents from an array of rdSplinePopulateData structs
int32 rdPopulateSpline(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,const TArray<FrdSplinePopulateData>& data,TArray<FrdSplineInstanceData>& instData,bool random=false,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Remove SplineMeshComponents attached to this spline
void rdRemoveSplineSMCs(AActor* actor,USplineComponent* spline);

#ifdef includeProceduralMeshStuff
// [rdInst v1.35] Populate the Spline with ProceduralMeshComponents from a single mesh
int32 rdPopulateSplinePMCFast(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,UStaticMesh* mesh,UMaterialInterface* mat=nullptr,const FVector scale=FVector(1,1,1),const TEnumAsByte<ESplineMeshAxis::Type> axis=ESplineMeshAxis::X,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Populate the Spline with ProceduralMeshComponents from an array of rdSplinePopulateData structs
int32 rdPopulateSplinePMC(AActor* actor,USplineComponent* spline,float startDistance,float endDistance,const TArray<FrdSplinePopulateData>& data,TArray<FrdSplineInstanceData>& instData,bool random=false,bool useCollision=false,bool useRoll=false);

// [rdInst v1.35] Remove ProceduralMeshComponents attached to this spline
void rdRemoveSplinePMCs(AActor* actor,USplineComponent* spline);
#endif

// [rdInst v1.35] Comparision of two Spline Sections
static bool equalEqual(const FrdSplineInstanceData& A,const FrdSplineInstanceData& B) { return A==B; }

// [rdInst v1.35] Comparision of two Spline Sections
static bool notEqual(const FrdSplineInstanceData& A,const FrdSplineInstanceData& B) { return A!=B; }

// [rdInst v1.35] Internal, but Public methods
FSplinePoint		FillSplinePoint(USplineComponent* spline,int32 point,float startKey=0.0f);
float				BuildBPSplineSection(const AActor* actor,float startOffset,int32& index);
AActor*				DuplicateActor(const AActor* actor);
int32				GetSubSplineIndex(const AActor* actor);
USplineComponent*	GetSpline(const AActor* actor);
void				CopySplinePoint(USplineComponent* s1,int32 i1,USplineComponent* s2,int32 i2,FVector& loc,FRotator& rot,FVector& scale);