UKismetMathLibrary::Vector4_Size3
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns the Euclidean length of the XYZ components of a FVector4, ignoring the W element entirely. Use this when you have homogeneous coordinates or a 4D vector and only care about the spatial magnitude.
Caveats & Gotchas
- • W is completely ignored — if your vector represents a point (W=1) rather than a direction (W=0), the result is still just the XYZ length, which may or may not be what you want.
- • Returns a double; if you need float precision for performance-sensitive inner loops, cast the result explicitly to avoid accidental implicit narrowing elsewhere in your expression.
Signature
static UE_INL_API double Vector4_Size3(const FVector4& A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | The vector whose XYZ length is computed. | — |
Return Type
double Example
Check XYZ length of a Vector4 C++
FVector4 Vec(3.0, 0.0, 4.0, 1.0);
double Len = UKismetMathLibrary::Vector4_Size3(Vec); // 5.0 Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?