UKismetMathLibrary::Divide_IntPointInt
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPureUFUNCTION
Description
Divides both components of IntPoint A by scalar integer B using truncating integer division, returning a new FIntPoint.
Caveats & Gotchas
- • Passing B = 0 triggers ReportError_Divide_IntPointOnInt() and returns (0, 0). Always guard against zero divisors when B is runtime-determined.
- • Truncation toward zero means that dividing odd-sized grids may produce asymmetric results — e.g. halving a width of 7 yields 3, not 3.5.
Signature
static UE_INL_API FIntPoint Divide_IntPointInt(FIntPoint A, int32 B); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FIntPoint | The dividend IntPoint. | — |
| B | int32 | Scalar divisor. Must not be zero. | — |
Return Type
FIntPoint Example
Halve a grid size to get the centre cell offset C++
FIntPoint GridSize(16, 12);
FIntPoint HalfSize = UKismetMathLibrary::Divide_IntPointInt(GridSize, 2);
// HalfSize == (8, 6) Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?