UKismetMathLibrary::Add_MatrixMatrix
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Adds two 4x4 matrices element-wise (A + B). This is a linear algebra operation, not a transform composition — the result is not generally a valid transform matrix.
Caveats & Gotchas
- • Adding two transform matrices does not produce a composed transformation. Use Multiply_MatrixMatrix to combine transforms. Matrix addition is used in shader math and blending operations, rarely in gameplay transform code.
- • The result of adding two rotation or transform matrices will typically not be orthogonal — do not pass it to functions that assume a valid transform matrix without re-orthogonalizing first.
Signature
static UE_INL_API FMatrix Add_MatrixMatrix (const FMatrix& A, const FMatrix& B) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | const FMatrix& | The first matrix. | — |
| B | const FMatrix& | The second matrix. | — |
Return Type
FMatrix Example
Blend two skinning matrices (linear blend skinning style) C++
// Simple linear blend — result must be re-normalized before use as a transform
FMatrix BlendedMatrix = UKismetMathLibrary::Add_MatrixMatrix(
UKismetMathLibrary::Multiply_MatrixFloat(SkinMatrix0, Weight0),
UKismetMathLibrary::Multiply_MatrixFloat(SkinMatrix1, Weight1)
); Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?