Skip to content

Commit 33e13c1

Browse files
committed
Typos + rotation order fix
1 parent 85ac909 commit 33e13c1

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Source/PCGExtendedToolkit/Private/Transform/PCGExFitting.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void FPCGExFittingVariations::ApplyOffset(const FRandomStream& RandomStream, FTr
298298

299299
FVector OutLocation = bAbsoluteOffset ? BaseLocation + RandomOffset : BaseLocation + BaseRotation.RotateVector(RandomOffset);
300300

301-
if (SnapPosition == EPCGExVariationSnapping::SnapOffset)
301+
if (SnapPosition == EPCGExVariationSnapping::SnapResult)
302302
{
303303
PCGExMath::Snap(OutLocation.X, OffsetSnap.X);
304304
PCGExMath::Snap(OutLocation.Y, OffsetSnap.Y);
@@ -319,27 +319,27 @@ void FPCGExFittingVariations::ApplyRotation(const FRandomStream& RandomStream, F
319319

320320
if (SnapRotation == EPCGExVariationSnapping::SnapOffset)
321321
{
322+
PCGExMath::Snap(RandRot.Roll, RotationSnap.Roll);
322323
PCGExMath::Snap(RandRot.Pitch, RotationSnap.Pitch);
323324
PCGExMath::Snap(RandRot.Yaw, RotationSnap.Yaw);
324-
PCGExMath::Snap(RandRot.Roll, RotationSnap.Roll);
325325
}
326326

327327
FRotator OutRotation = BaseRotation.Rotator();
328328

329-
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::X)) { OutRotation.Pitch = RandRot.Pitch; }
329+
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::X)) { OutRotation.Roll = RandRot.Roll; }
330+
else { OutRotation.Roll += RandRot.Roll; }
331+
332+
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::Y)) { OutRotation.Pitch = RandRot.Pitch; }
330333
else { OutRotation.Pitch += RandRot.Pitch; }
331334

332-
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::Y)) { OutRotation.Yaw = RandRot.Yaw; }
335+
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::Z)) { OutRotation.Yaw = RandRot.Yaw; }
333336
else { OutRotation.Yaw += RandRot.Yaw; }
334337

335-
if (AbsoluteRotation & static_cast<uint8>(EPCGExAbsoluteRotationFlags::Z)) { OutRotation.Roll = RandRot.Roll; }
336-
else { OutRotation.Roll += RandRot.Roll; }
337-
338338
if (SnapRotation == EPCGExVariationSnapping::SnapResult)
339339
{
340+
PCGExMath::Snap(OutRotation.Roll, RotationSnap.Roll);
340341
PCGExMath::Snap(OutRotation.Pitch, RotationSnap.Pitch);
341342
PCGExMath::Snap(OutRotation.Yaw, RotationSnap.Yaw);
342-
PCGExMath::Snap(OutRotation.Roll, RotationSnap.Roll);
343343
}
344344

345345
OutTransform.SetRotation(OutRotation.Quaternion());

Source/PCGExtendedToolkit/Public/Transform/PCGExTransformPoints.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class UPCGExTransformPointsSettings : public UPCGExPointsProcessorSettings
2626
//~Begin UPCGSettings
2727
#if WITH_EDITOR
2828
PCGEX_NODE_INFOS(TransformPoints, "Transform Points", "A Transform points with the same settings found in Asset Collection variations, with attribute override support.");
29-
virtual FLinearColor GetNodeTitleColor() const override { return GetDefault<UPCGExGlobalSettings>()->ColorTransform; }
29+
virtual EPCGSettingsType GetType() const override{return EPCGSettingsType::PointOps;}
30+
virtual FLinearColor GetNodeTitleColor() const override { return GetDefault<UPCGExGlobalSettings>()->WantsColor(GetDefault<UPCGExGlobalSettings>()->ColorTransform); }
3031
#endif
3132

3233
protected:

0 commit comments

Comments
 (0)