UKismetMathLibrary::Vector4_SizeSquared3
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns X*X + Y*Y + Z*Z for the vector, ignoring W. Prefer this over Vector4_Size3 whenever you are comparing lengths or checking thresholds, as it avoids a square root.
Caveats & Gotchas
- • W is ignored — a W value of 0 or 1 has no effect on the result.
- • The return type is double; comparing against a float threshold requires care to avoid implicit precision differences.
Signature
static UE_INL_API double Vector4_SizeSquared3(const FVector4& A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | The vector whose XYZ squared length is computed. | — |
Return Type
double Example
Distance threshold check without sqrt C++
FVector4 Vec(1.0, 2.0, 2.0, 0.0);
if (UKismetMathLibrary::Vector4_SizeSquared3(Vec) < 9.0)
{
// XYZ length < 3
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?