UKismetMathLibrary::Conv_IntVector2ToVector2D
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureBlueprintAutocast
Description
Converts an FIntVector2 (two int32 components) to an FVector2D (two doubles) component-wise.
Caveats & Gotchas
- • FIntVector2 was introduced in UE 5.2; projects targeting UE 5.1 or earlier will not have this type or function.
- • The conversion is lossless for the int32 range, but if the resulting FVector2D is used for UV coordinates (expected range 0–1) ensure you divide by texture resolution after converting.
Signature
static UE_INL_API FVector2D Conv_IntVector2ToVector2D(const FIntVector2& InIntVector2) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InIntVector2 | const FIntVector2& | The 2D integer vector to convert to floating-point. | — |
Return Type
FVector2D Example
Convert pixel coordinates to normalised UVs C++
FIntVector2 PixelCoord(128, 64);
FVector2D UV = UKismetMathLibrary::Conv_IntVector2ToVector2D(PixelCoord)
/ FVector2D(TextureWidth, TextureHeight); Tags
Version History
Introduced in: 5.2
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?