UKismetMathLibrary::Vector4_CrossProduct3
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Computes the 3D cross product of the XYZ components of two Vector4 values. The resulting W component is 0.
Caveats & Gotchas
- • The W component of both input vectors is ignored. The result always has W=0, making it suitable as a direction vector but not a homogeneous point.
- • Cross product is anti-commutative: CrossProduct3(A, B) == -CrossProduct3(B, A). The order of operands determines the handedness of the resulting normal, which affects face culling if the result is used as a surface normal.
Signature
static UE_INL_API FVector4 Vector4_CrossProduct3(const FVector4& A, const FVector4& B) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FVector4& | First vector. Only the XYZ components are used. | — |
| B | const FVector4& | Second vector. Only the XYZ components are used. | — |
Return Type
FVector4 Example
Compute a surface normal from two edge vectors C++
FVector4 Edge1(1.0, 0.0, 0.0, 0.0);
FVector4 Edge2(0.0, 1.0, 0.0, 0.0);
FVector4 Normal = UKismetMathLibrary::Vector4_CrossProduct3(Edge1, Edge2);
// Normal == (0, 0, 1, 0) — pointing up Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?