UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GizmoMath Namespace Reference

Functions

INTERACTIVETOOLSFRAMEWORK_API FVector ProjectPointOntoLine (const FVector &Point, const FVector &LineOrigin, const FVector &LineDirection)
 
INTERACTIVETOOLSFRAMEWORK_API void NearestPointOnLine (const FVector &LineOrigin, const FVector &LineDirection, const FVector &QueryPoint, FVector &NearestPointOut, float &LineParameterOut)
 
INTERACTIVETOOLSFRAMEWORK_API void NearestPointOnLineToRay (const FVector &LineOrigin, const FVector &LineDirection, const FVector &RayOrigin, const FVector &RayDirection, FVector &NearestLinePointOut, float &LineParameterOut, FVector &NearestRayPointOut, float &RayParameterOut)
 
INTERACTIVETOOLSFRAMEWORK_API void RayPlaneIntersectionPoint (const FVector &PlaneOrigin, const FVector &PlaneNormal, const FVector &RayOrigin, const FVector &RayDirection, bool &bIntersectsOut, FVector &PlaneIntersectionPointOut)
 
INTERACTIVETOOLSFRAMEWORK_API void RaySphereIntersection (const FVector &SphereOrigin, const float SphereRadius, const FVector &RayOrigin, const FVector &RayDirection, bool &bIntersectsOut, FVector &SphereIntersectionPointOut)
 
template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API RayCylinderIntersection (const FVector &CylinderCenter, const FVector &CylinderAxis, RealType CylinderRadius, RealType CylinderHeight, const FVector &RayOrigin, const FVector &RayDirection, bool &bIntersectsOut, RealType &OutHitDepth)
 
template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API RayConeIntersection (const FVector &ConeCenter, const FVector &ConeDirection, RealType ConeCosAngle, RealType ConeHeight, const FVector &RayOrigin, const FVector &RayDirection, bool &bIntersectsOut, RealType &OutHitDepth)
 
template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API IntervalIntervalIntersection (const RealType Interval0[2], const RealType Interval1[2], int &OutNumIntersections, RealType &OutResult0, RealType &OutResult1)
 
INTERACTIVETOOLSFRAMEWORK_API void ClosetPointOnCircle (const FVector &QueryPoint, const FVector &CircleOrigin, const FVector &CircleNormal, float CircleRadius, FVector &ClosestPointOut)
 
INTERACTIVETOOLSFRAMEWORK_API void MakeNormalPlaneBasis (const FVector &PlaneNormal, FVector &BasisAxis1Out, FVector &BasisAxis2Out)
 
INTERACTIVETOOLSFRAMEWORK_API float ComputeAngleInPlane (const FVector &Point, const FVector &PlaneOrigin, const FVector &PlaneNormal, const FVector &PlaneAxis1, const FVector &PlaneAxis2)
 
INTERACTIVETOOLSFRAMEWORK_API FVector2D ComputeCoordinatesInPlane (const FVector &Point, const FVector &PlaneOrigin, const FVector &PlaneNormal, const FVector &PlaneAxis1, const FVector &PlaneAxis2)
 
INTERACTIVETOOLSFRAMEWORK_API FVector ProjectPointOntoPlane (const FVector &Point, const FVector &PlaneOrigin, const FVector &PlaneNormal)
 
template<typename RealType >
INTERACTIVETOOLSFRAMEWORK_API RealType SnapToIncrement (RealType Value, RealType Increment)
 
INTERACTIVETOOLSFRAMEWORK_API FVector GetOrthogonalVector (const FVector &V)
 

Detailed Description

GizmoMath functions implement various vector math/geometry operations required to implement various standard Gizmos. Although some of these are standard queries, in the context of user interface Gizmos they may have behaviors (like assumptions about valid ranges or error-handling) that would not be suitable for general-purpose math code.

Function Documentation

◆ ClosetPointOnCircle()

void GizmoMath::ClosetPointOnCircle ( const FVector QueryPoint,
const FVector CircleOrigin,
const FVector CircleNormal,
float  CircleRadius,
FVector ClosestPointOut 
)

Find the closest point to QueryPoint that is on the circle defined by CircleOrigin, CircleNormal, and CircleRadius.

◆ ComputeAngleInPlane()

float GizmoMath::ComputeAngleInPlane ( const FVector Point,
const FVector PlaneOrigin,
const FVector PlaneNormal,
const FVector PlaneAxis1,
const FVector PlaneAxis2 
)

Project the input Point into the plane defined by PlaneOrigin and PlaneNormal, and then measure it's signed angle relative to the in-plane X and Y axes defined by PlaneAxis1 and PlaneAxis2

Returns
the signed angle

◆ ComputeCoordinatesInPlane()

FVector2D GizmoMath::ComputeCoordinatesInPlane ( const FVector Point,
const FVector PlaneOrigin,
const FVector PlaneNormal,
const FVector PlaneAxis1,
const FVector PlaneAxis2 
)

Project the input Point into the plane defined by PlaneOrigin and PlaneNormal, and then calculate it's UV coordinates in the space defined by the plane axes PlaneAxis1 and PlaneAxis2

Returns
the UV coordinates

◆ GetOrthogonalVector()

FVector GizmoMath::GetOrthogonalVector ( const FVector V)
Returns
Orthogonal vector

◆ IntervalIntervalIntersection()

template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API GizmoMath::IntervalIntervalIntersection ( const RealType  Interval0[2],
const RealType  Interval1[2],
int &  OutNumIntersections,
RealType &  OutResult0,
RealType &  OutResult1 
)

Find the intersection of two floating point intervals in which the interval inputs contain pairs of floats sorted in increasing order. Returns the number of intersections intersection and intersection results in increasing order.

◆ MakeNormalPlaneBasis()

void GizmoMath::MakeNormalPlaneBasis ( const FVector PlaneNormal,
FVector BasisAxis1Out,
FVector BasisAxis2Out 
)

Construct two mutually-perpendicular unit vectors BasisAxis1Out and BasisAxis2Out which are orthogonal to PlaneNormal

◆ NearestPointOnLine()

void GizmoMath::NearestPointOnLine ( const FVector LineOrigin,
const FVector LineDirection,
const FVector QueryPoint,
FVector NearestPointOut,
float LineParameterOut 
)

Find the nearest point to QueryPoint on the line defined by LineOrigin and LineDirection. Returns this point and the associated line-equation parameter

◆ NearestPointOnLineToRay()

void GizmoMath::NearestPointOnLineToRay ( const FVector LineOrigin,
const FVector LineDirection,
const FVector RayOrigin,
const FVector RayDirection,
FVector NearestLinePointOut,
float LineParameterOut,
FVector NearestRayPointOut,
float RayParameterOut 
)

Find the closest pair of points on a 3D line and 3D ray. Returns the points and line-equation parameters on both the line and ray.

◆ ProjectPointOntoLine()

FVector GizmoMath::ProjectPointOntoLine ( const FVector Point,
const FVector LineOrigin,
const FVector LineDirection 
)

Project a point onto the line defined by LineOrigin and LineDirection

Returns
projected point

◆ ProjectPointOntoPlane()

FVector GizmoMath::ProjectPointOntoPlane ( const FVector Point,
const FVector PlaneOrigin,
const FVector PlaneNormal 
)

Project the input Point onto the plane defined by PlaneOrigin and PlaneNormal,

Returns
Nearest position to Point lying in the plane

◆ RayConeIntersection()

template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API GizmoMath::RayConeIntersection ( const FVector ConeCenter,
const FVector ConeDirection,
RealType  ConeCosAngle,
RealType  ConeHeight,
const FVector RayOrigin,
const FVector RayDirection,
bool bIntersectsOut,
RealType &  OutHitDepth 
)

Find the intersection of the ray defined by RayOrigin and RayDirection with the cone defined by ConeCenter, ConeDirection, ConeCosAngle, and ConeHeight. Where ConeCosAngle is the cosine of the cone opening angle, defined as the angle at the apex between the cone's axis and slant edge. Returns intersection success/failure in bOutIntersects and the hit depth parameter along the ray for the first intersection in OutHitDepth.

◆ RayCylinderIntersection()

template<typename RealType >
void INTERACTIVETOOLSFRAMEWORK_API GizmoMath::RayCylinderIntersection ( const FVector CylinderCenter,
const FVector CylinderAxis,
RealType  CylinderRadius,
RealType  CylinderHeight,
const FVector RayOrigin,
const FVector RayDirection,
bool bIntersectsOut,
RealType &  OutHitDepth 
)

Find the intersection of the ray defined by RayOrigin and RayDirection with the cylinder defined by CylinderCenter, CylinderAxis, CylinderRadius, and CylinderHeight. Returns intersection success/failure in bOutIntersects and the hit depth parameter along the ray for the first intersection in OutHitDepth.

◆ RayPlaneIntersectionPoint()

void GizmoMath::RayPlaneIntersectionPoint ( const FVector PlaneOrigin,
const FVector PlaneNormal,
const FVector RayOrigin,
const FVector RayDirection,
bool bIntersectsOut,
FVector PlaneIntersectionPointOut 
)

Find the intersection of the ray defined by RayOrigin and RayDirection with the plane defined by PlaneOrigin and PlaneNormal. Returns intersection success/failure in bIntersectsOut and the intersection point in PlaneIntersectionPointOut

◆ RaySphereIntersection()

void GizmoMath::RaySphereIntersection ( const FVector SphereOrigin,
const float  SphereRadius,
const FVector RayOrigin,
const FVector RayDirection,
bool bIntersectsOut,
FVector SphereIntersectionPointOut 
)

Find the intersection of the ray defined by RayOrigin and RayDirection with the sphere defined by SphereOrigin and SphereRadius. Returns intersection success/failure in bIntersectsOut and the intersection point in SphereIntersectionPointOut

◆ SnapToIncrement()

template<typename RealType >
INTERACTIVETOOLSFRAMEWORK_API RealType GizmoMath::SnapToIncrement ( RealType  Value,
RealType  Increment 
)

Round Value to nearest step of Increment

Returns
snapped/rounded value