RealDocs

UKismetMathLibrary::Vector_ComponentMin

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

Description

Returns a vector whose each component is the minimum of the corresponding components from A and B: (min(A.X,B.X), min(A.Y,B.Y), min(A.Z,B.Z)). Used to compute the minimum-extent corner of a bounding box from two points.

Caveats & Gotchas

  • This is a component-wise operation, not a magnitude comparison. The result is not necessarily a 'smaller' vector in a geometric sense.
  • Useful for computing AABB min/max corners: Min = ComponentMin(A, B), Max = ComponentMax(A, B).
  • Equivalent to FVector::ComponentMin on the FVector type directly.

Signature

static UE_INL_API FVector Vector_ComponentMin(FVector A, FVector B);

Parameters

Name Type Description Default
A FVector First vector.
B FVector Second vector.

Return Type

FVector

Example

Build an AABB from two corner points C++
FVector CornerA = FVector(10.f, -5.f, 100.f);
FVector CornerB = FVector(-20.f, 30.f, 50.f);
FVector BoxMin = UKismetMathLibrary::Vector_ComponentMin(CornerA, CornerB);
FVector BoxMax = UKismetMathLibrary::Vector_ComponentMax(CornerA, CornerB);
// BoxMin = (-20, -5, 50), BoxMax = (10, 30, 100)

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.