/ResSplineMeshComp

Resizable Spline Mesh Component

Primary LanguageC++

Resizable Spline Mesh Component (RSplineMeshComp)

This component use a "brute force" method to create a Spline Mesh at runtime.

Source code of the component is in Components/RSplineMeshComponent.cpp/h

alt text

The component have two CreateSplineMesh functions, one that use vectors for start and end positions, the second instead use actors.

alt text

The ChunkLength parameter is the distance between two spline points, that means the sub-SplineMeshComponent will have that length.

alt text

The ZOffset parameter will rise up/down the Spline on Z axis

alt text

The IncludeLastChunk boolean will allow to add (or not) a SplineMeshComponent at the end of the Spline, this is useful in case you have some stuff attached at the end position and you don't want to overlap the SplineMesh with it (like the red circle in the first picture).

alt text

alt text

Here an example use of the component, as you can see the CreateSplineMeshV function is called on Tick, the function destroy and recreate the Spline and it looks like we are adding/removing chunks at runtime, BE CAREFUL and DON'T use a low ChunkLength value to prevent performance issue! With a value > 25.f we have a good effect with no fps drops.

alt text