Yeah but that would be in an easy/ideal world
Unfortunately it’s not always circular as it’s plotting an orbit, which is a) never ‘perfectly’ circular and can also have some eccentricity. This is how I’m currently attempting to plot the tangents. The problem is, I don’t know if ‘Source Tangent’ in the Particle System is the tangent going into the point, or if it’s the tangent leaving the point. I would guess leaving the point, and ‘Target Tangent’ would be the arrival tangent at the next point.
The code below gives me the same solid lines between each point, like I had no tangents at all. The orbit has to connect at the ends too, hence the special cases for i == 0 and i == last index.
/* Get amount of entries in the Array, Subtract 1 so we get a full loop */
uint32 LastIndex = InSplinePoints.Num() - 1;
for (uint32 i = 0; i <= LastIndex; i++)
{
/* If we are the last point, we need to get the first point in the array for the end tangent */
if (i == LastIndex)
{
InputPS->SetBeamSourcePoint(0, InSplinePoints*, i);
InputPS->SetBeamTargetPoint(0, InSplinePoints[0], i);
/* Tangent Towards The Next Point In The Spline */
FVector LeaveTangent = FVector(InSplinePoints[i - 1] - InSplinePoints[0]);
LeaveTangent.Normalize();
InputPS->SetBeamSourceTangent(0, LeaveTangent, i);
}
else if (i == 0)
{
InputPS->SetBeamSourcePoint(0, InSplinePoints*, i);
InputPS->SetBeamTargetPoint(0, InSplinePoints[i + 1], i);
/* Tangent Towards The Next Point In The Spline */
FVector LeaveTangent = FVector(InSplinePoints[LastIndex] - InSplinePoints[i + 1]);
LeaveTangent.Normalize();
InputPS->SetBeamSourceTangent(0, LeaveTangent, i);
}
else
{
InputPS->SetBeamSourcePoint(0, InSplinePoints*, i);
InputPS->SetBeamTargetPoint(0, InSplinePoints[i + 1], i);
/* Tangent Towards The Next Point In The Spline */
FVector LeaveTangent = FVector(InSplinePoints[i - 1] - InSplinePoints[i + 1]);
LeaveTangent.Normalize();
InputPS->SetBeamSourceTangent(0, LeaveTangent, i);
}
}