RealDocs

UKismetMathLibrary::Vector_MirrorByPlane

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Mirrors a vector (as a position) across a plane. Unlike MirrorVectorByNormal, this accounts for the plane's offset from the origin via the W component of FPlane.

Caveats & Gotchas

  • FPlane stores its normal in X/Y/Z and its distance from origin in W. Forgetting to set W=0 when you mean to mirror across a plane through the origin will introduce an unexpected translation in the result.
  • This mirrors the vector as a *point* relative to the plane, not just its direction. If you only want to reflect a direction about a normal (ignoring the plane's position), use GetReflectionVector instead.

Signature

static UE_INL_API FVector Vector_MirrorByPlane(FVector A, const FPlane& InPlane);

Parameters

Name Type Description Default
A FVector The vector (treated as a point) to mirror.
InPlane const FPlane& The plane to mirror across, defined by a normal and a W offset.

Return Type

FVector

Example

Mirror a spawn point across the ground plane C++
// Plane at Z=0 facing up (W=0 means through origin)
FPlane GroundPlane(FVector::UpVector, 0.f);
FVector Mirrored = UKismetMathLibrary::Vector_MirrorByPlane(SpawnPos, GroundPlane);
// Mirrored.Z = -SpawnPos.Z

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.