|
Yasiu Spline Meshed 1
Extension of basic spline for use with meshes.
|
Core component that handles meshes spawning along spline. More...
#include <SplineMeshedComponent.h>
Public Member Functions | |
| void | PlaceMeshesAlongSpline (UStaticMesh *Mesh, const FSplineMeshedSpawnParams SpawnParameters) |
| Spawn meshes along spline by given params. Override if you intend to clear/set variables before spawning meshes. | |
| void | GetMeshPositonsArray (TArray< FYasiuSplineMeshParams > &OutArray, const UStaticMesh *Mesh, const FSplineMeshedSpawnParams ¶msIn) const |
| Function that evaluates mesh position and tangent based on params passed in. | |
| 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. | |
| int | Num () const |
| Current amount of meshes stored (may count invalid). | |
| void | ChangeMesh (TSoftObjectPtr< UStaticMesh > Mesh) |
| Change static mesh in all Objects. (Updates only mesh's tangents). | |
| void | GetMeshes (TArray< class USplineMeshComponent * > &OutArray) const |
| Returns Copy of array containing only valid SplineMesh objects. | |
| virtual void | SetMaterialsByIndex (const TArray< UMaterialInterface * > &materials) |
| Applies materials from array to all meshes. | |
| virtual void | CopySplinePoints (const USplineMeshedComponent *copyFrom) |
| Copy spline points and curve. | |
| virtual void | CopySplineAndMeshes (const USplineMeshedComponent *copyFrom) |
| Copy spline points, curve and mesh properties. | |
| void | MakeHelix (const FSplineHelixParams &HelixParams) |
| Function that changes points to helix. | |
| void | MakeSinus (const FSplineSinusParams &SinusParams) |
| Function that changes points to sinus. | |
| ASplineMeshActor * | SpawnMeshStaticClone (const USplineMeshComponent *Mesh) |
| Spawns static actor in world and copies spline mesh properties. | |
| TArray< ASplineMeshActor * > | CloneSplineToStaticActors () |
| clone of all meshes in spline and make them static object | |
| 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! | |
| void | SetSmoothnessAtAllPoints (float smoothness=1.f, float ZRotationDeg=0.f) |
| Change spline all points to have desired params. | |
| void | OffsetAllPoints (const FVector &RelativeOffset) |
| Function used to move all spline points with given relative offset. | |
| void | Sharp () |
| Function will adjust tangents of all points to make it sharp. | |
| void | Soft () |
| Function will adjust tangents of all points to make it look smooth. | |
| void | Smooth () |
| Function will set all points type to Curve (they auto update tangents). | |
| void | ExtraCurvy () |
| Function will adjust tangents of all points to make it look extra smooth and very curvy. | |
| void | CustomTangents () |
| Function will adjust tangents of single point using TangentToolParams variable. | |
| void | CustomTangentsAllPoints () |
| Function will adjust tangents of all spline points using TangentToolParams variable. | |
| bool | DetectObjectsAlongSpline (TArray< FSplineMeshedOverlapResult > &DetectResults, FSplineDetectionTestParams DetectionParams) const |
| Detection function that iterates along spline and does multiple checks. Function evaluates shape of given mesh. | |
| 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, it detects overlaps by object type. | |
| 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. | |
| 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. | |
| 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. | |
Static Public Member Functions | |
| static void | ApplyParamsToMesh (const FYasiuSplineMeshParams ¶ms, USplineMeshComponent *Mesh) |
| Applies all parameters from struct to SplineMesh Object, without Update. Except ForwardDirection and StaticMesh. | |
| static void | CopyMeshMaterials (const UMeshComponent *copyFrom, UMeshComponent *copyTo) |
| Copy materials between meshes. | |
Public Attributes | |
| FSplineSinusParams | SinusToolParams {} |
| Parameters to create sinus spline in editor. | |
| FSplineHelixParams | HelixToolParams {} |
| Parameters to create helix spline in editor. | |
| FSplineSmoothParams | TangentToolParams {} |
| Parameter used by editor commands. | |
Protected Attributes | |
| TArray< TObjectPtr< USplineMeshComponent > > | MeshesArray |
| Array of created SplineMeshes. | |
Core component that handles meshes spawning along spline.
| void USplineMeshedComponent::ChangeMesh | ( | TSoftObjectPtr< UStaticMesh > | Mesh | ) |
Change static mesh in all Objects. (Updates only mesh's tangents).
| Mesh | Reference to mesh asset |
| TArray< ASplineMeshActor * > USplineMeshedComponent::CloneSplineToStaticActors | ( | ) |
clone of all meshes in spline and make them static object
| void USplineMeshedComponent::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, it detects overlaps by object type.
Other objects must have Collision "Query" enabled and math collision channel in paramsIn
| DetectedObjects | Output array, passed to top function. |
| World | World reference used to run detection |
| LocationIn | Location of detection |
| RotationIn | Rotation of detection |
| ParamsIn | Collection of params used for detection |
| bool USplineMeshedComponent::DetectObjectsAlongSpline | ( | TArray< FSplineMeshedOverlapResult > & | DetectResults, |
| FSplineDetectionTestParams | DetectionParams ) const |
Detection function that iterates along spline and does multiple checks. Function evaluates shape of given mesh.
By default, it detects Overlaps, objects must have Collision "Query" enabled (Physics is not required).
Returns all objects of given type, ignoring their ChannelType responses.
| DetectResults | Output array of detected actors |
| DetectionParams | Struct that has test parameters |
| void USplineMeshedComponent::GetMeshes | ( | TArray< class USplineMeshComponent * > & | OutArray | ) | const |
Returns Copy of array containing only valid SplineMesh objects.
| OutArray | Array with pointers to all valid objects. |
| void USplineMeshedComponent::OffsetAllPoints | ( | const FVector & | RelativeOffset | ) |
Function used to move all spline points with given relative offset.
| RelativeOffset | Relative offset to apply |
| void USplineMeshedComponent::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.
Use this function to modify placing behaviour
| ForwardVec | Vector from mesh start to mesh end |
| UpVect | Spline's up vector for this mesh |
| SegmentID | Mesh number, indexed from <0, N-1> |
| DistanceA | Spline distance along spline at start of mesh in unreal units |
| DistanceB | Spline distance along spline at end of mesh in unreal units |
| RefMesh | Spline Mesh reference for custom edits |
| void USplineMeshedComponent::PlaceMeshesAlongSpline | ( | UStaticMesh * | Mesh, |
| const FSplineMeshedSpawnParams | SpawnParameters ) |
Spawn meshes along spline by given params. Override if you intend to clear/set variables before spawning meshes.
| Mesh | Static mesh object to be used |
| SpawnParameters | Parameters how mesh should spawn |
|
virtual |
Applies materials from array to all meshes.
Materials are applied to each slot defined by array <0, N>.
| void USplineMeshedComponent::SetSmoothnessAtAllPoints | ( | float | smoothness = 1.f, |
| float | ZRotationDeg = 0.f ) |
Change spline all points to have desired params.
| smoothness | How smooth should spline be, 0 means sharp spline, 1 means smooth. Works with negative values |
| ZRotationDeg | Angle in degrees. Rotation around Z axis for cool effects |
| void USplineMeshedComponent::SetSmoothnessAtPoint | ( | int | keyIndex, |
| float | smoothness = 1.f, | ||
| float | ZRotationDeg = 0.f ) |
Change single point to have given smoothness and rotation. Does not update actor!
| keyIndex | Spline point index |
| smoothness | How smooth should spline be, 0 means sharp spline, 1 means smooth. Works with negative values |
| ZRotationDeg | Angle in degrees. Rotation around Z axis for cool effects |
| FVector USplineMeshedComponent::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.
| distanceA | distance along spline for point A |
| distanceB | distance along spline for point B |
| CoordSpace | Coordinate space, World or Local |