| 642 | } |
| 643 | |
| 644 | void FPCGExSplineMeshMutationDetails::Mutate(const int32 PointIndex, PCGExPaths::FSplineMeshSegment& InSegment) |
| 645 | { |
| 646 | if (!bPushStart && !bPushEnd) { return; } |
| 647 | |
| 648 | const double Size = (bPushStart || bPushEnd) && (bRelativeStart || bRelativeEnd) ? FVector::Dist(InSegment.Params.StartPos, InSegment.Params.EndPos) : 1; |
| 649 | const FVector StartDir = InSegment.Params.StartTangent.GetSafeNormal(); |
| 650 | const FVector EndDir = InSegment.Params.EndTangent.GetSafeNormal(); |
| 651 | |
| 652 | if (bPushStart) |
| 653 | { |
| 654 | const double Factor = StartAmount->Read(PointIndex); |
| 655 | const double Dist = bRelativeStart ? Size * Factor : Factor; |
| 656 | |
| 657 | InSegment.Params.StartPos -= StartDir * Dist; |
| 658 | InSegment.Params.StartTangent = StartDir * (InSegment.Params.StartTangent.Size() + Dist * 3); |
| 659 | } |
| 660 | |
| 661 | if (bPushEnd) |
| 662 | { |
| 663 | const double Factor = EndAmount->Read(PointIndex); |
| 664 | const double Dist = bRelativeEnd ? Size * Factor : Factor; |
| 665 | |
| 666 | InSegment.Params.EndPos += EndDir * Dist; |
| 667 | InSegment.Params.EndTangent = EndDir * (InSegment.Params.EndTangent.Size() + Dist * 3); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | #undef LOCTEXT_NAMESPACE |
| 672 | #undef PCGEX_NAMESPACE |
no test coverage detected