Kikbow
(Kikbow)
February 16, 2021, 11:48am
1
How to replicate:
float InputDistance = Spline->GetDistanceAlongSplineAtSplinePoint(23)
float InputKeyFromDistance = Spline->GetInputKeyAtDistanceAlongSpline(InputDistance)
Expected return: 23
Returned value: 23 but divided by the last input key of the spline
So in a spline with 101 points, instead of returning 23 it will return 23 / 100 = 0.23
NahorCA
(NahorCA)
October 25, 2022, 10:25pm
2
Another illustration of the issue:
FVector V1 = SplineComponent->GetLocationAtDistanceAlongSpline(Distance, ESplineCoordinateSpace::World);
float Key = SplineComponent->GetInputKeyAtDistanceAlongSpline(Distance);
FVector V2 = SplineComponent->GetLocationAtSplineInputKey(Key, ESplineCoordinateSpace::World);
v1
and v2
are different when there are more than one segment in the spline.
In other words, “input key” has different meanings/values depending if it’s a return value or an input parameter.