UKismetRenderingLibrary::CalculateProjectionMatrix
#include "Kismet/KismetRenderingLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Calculates a projection matrix from a FMinimalViewInfo, using its own aspect ratio regardless of whether bConstrainAspectRatio is set.
Caveats & Gotchas
- • Ignores bConstrainAspectRatio on the view info — the resulting matrix always uses the view's raw aspect ratio, which may differ from what you'd see in the actual game viewport if aspect ratio constraints are active.
- • Displayed in Blueprint as 'Calculate Projection Matrix (Minimal View Info)' due to the DisplayName meta, not the raw function name.
- • Useful for custom render-to-texture or camera math, but this does not account for any post-process or lens settings beyond what's stored on FMinimalViewInfo.
Signature
static FMatrix CalculateProjectionMatrix(const FMinimalViewInfo& MinimalViewInfo) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| MinimalViewInfo | const FMinimalViewInfo& | View info (FOV, aspect ratio, ortho settings, near/far planes) to build a projection matrix from. | — |
Return Type
FMatrix Example
Compute a projection matrix from a camera's view info C++
FMinimalViewInfo ViewInfo;
CameraComponent->GetCameraView(0.f, ViewInfo);
FMatrix ProjMatrix = UKismetRenderingLibrary::CalculateProjectionMatrix(ViewInfo); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?