UKismetMathLibrary::Matrix_Mirror
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Mirrors a transform matrix across a given axis and flips one local axis to maintain correct handedness. Used for producing mirrored skeletal animations or planar reflections.
Caveats & Gotchas
- • Mirroring inverts the winding order of triangles — if you use the result to transform geometry, you must also flip face culling (e.g. EWindingMode) or the mesh will appear inside-out.
- • MirrorAxis and FlipAxis must not be the same axis; passing identical values produces a degenerate transform rather than a no-op.
Signature
static UE_INL_API FMatrix Matrix_Mirror(const FMatrix& M, TEnumAsByte<EAxis::Type> MirrorAxis, TEnumAsByte<EAxis::Type> FlipAxis) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| M | const FMatrix& | The transform matrix to mirror. | — |
| MirrorAxis | TEnumAsByte<EAxis::Type> | The world axis to mirror across. | — |
| FlipAxis | TEnumAsByte<EAxis::Type> | One of the local axes to flip after mirroring to correct handedness. | — |
Return Type
FMatrix Example
Mirror a bone transform across the YZ plane (X axis) C++
FMatrix BoneMatrix = BoneTransform.ToMatrixWithScale();
FMatrix Mirrored = UKismetMathLibrary::Matrix_Mirror(
BoneMatrix,
EAxis::X, // mirror across the X axis (YZ plane)
EAxis::Y // flip Y to preserve handedness
);
FTransform MirroredTransform = FTransform(Mirrored); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?