RealDocs

UKismetMathLibrary::Divide_IntPointIntPoint

function Engine Blueprint Since unknown
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPureUFUNCTION

Description

Divides IntPoint A by IntPoint B component-wise using integer (truncating) division, returning a new FIntPoint.

Caveats & Gotchas

  • Division by zero in either component triggers a logged error via ReportError_Divide_IntPointOnIntPoint() and returns (0, 0). Validate B before calling if its values come from user input or runtime data.
  • Result is truncated toward zero (C++ integer division), not floored. For negative values, -7 / 2 = -3, not -4. Use floating-point division via Conv_IntPointToVector2D if you need floor behaviour.

Signature

static UE_INL_API FIntPoint Divide_IntPointIntPoint(FIntPoint A, FIntPoint B);

Parameters

Name Type Description Default
A FIntPoint The dividend IntPoint.
B FIntPoint The divisor IntPoint. Neither component may be zero.

Return Type

FIntPoint

Example

Convert pixel coordinates back to tile indices C++
FIntPoint PixelPos(320, 192);
FIntPoint TileSize(64, 64);
FIntPoint TileIndex = UKismetMathLibrary::Divide_IntPointIntPoint(PixelPos, TileSize);
// TileIndex == (5, 3)

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.