RealDocs

UKismetMathLibrary::IsPointInBoxWithTransform

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

Description

Determines whether a world-space point lies inside a box that can be rotated, by transforming the point into the box's local space before testing. Includes points on the box.

Caveats & Gotchas

  • Point must be in the same world space as BoxWorldTransform — passing an already-local-space point produces incorrect results.
  • BoxExtent is a half-size in the box's local space, not world space, so scaling in BoxWorldTransform affects the effective world-space box size.
  • This is noticeably more expensive than IsPointInBox because it performs an inverse transform per call; avoid it in tight per-frame loops over many points when the box is axis-aligned and unrotated.

Signature

static bool IsPointInBoxWithTransform(FVector Point, const FTransform& BoxWorldTransform, FVector BoxExtent)

Parameters

Name Type Description Default
Point FVector The point to test, in world space.
BoxWorldTransform const FTransform& Component-to-world transform of the box, including its rotation.
BoxExtent FVector Half-size of the box along each axis, in the box's local (component) space.

Return Type

bool

Example

Test overlap against a rotated volume C++
FTransform VolumeTransform = RotatedVolumeActor->GetActorTransform();
FVector Extent = FVector(150.f, 150.f, 100.f);
bool bInside = UKismetMathLibrary::IsPointInBoxWithTransform(PlayerPawn->GetActorLocation(), VolumeTransform, Extent);

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.