You can get voulme BSP information and check manually against the point, but it is possible only in C++ as I know.
bool AMyVolume::IsPositionInside(const FVector& Position) const
{
bool bFallback = false;
#if WITH_EDITOR
if (ABrush::NeedsRebuild())
{
// Fallback to the collision tests when there is no valid model
UE_LOG(WaterMeshRuntime, Log, TEXT("Level BSP needs to rebuild."));
bFallback = true;
}
#endif
if (Brush == nullptr) {
// Fallback to the collision tests when there is no valid model
bFallback = true;
}
if (bFallback) {
UWorld* CurrentWorld = GetWorld();
return CurrentWorld ? CurrentWorld->OverlapAnyTestByChannel(Position, FQuat::Identity, ECollisionChannel::ECC_OverlapAll_Deprecated, FCollisionShape::MakeSphere(0.01f)) : false;
}
// Use volume bsp here
int32 nodeIx = 0;
const FBspNode* node = Brush->Nodes.GetData();
const FVector InnerPosition = GetTransform().InverseTransformPosition(Position);
while (node != nullptr)
{
// Check if point is in front of plane
if (node->Plane.PlaneDot(InnerPosition) > 0.0f)
{
// FRONT
if (node->iFront != INDEX_NONE)
{
node = &Brush->Nodes[node->iFront];
} else {
return !node->ChildOutside(1, Brush->RootOutside);
}
} else {
// BACK
if (node->iBack != INDEX_NONE) // If there is a child, recurse into it.
{
node = &Brush->Nodes[node->iBack];
} else {
return !node->ChildOutside(0, Brush->RootOutside);
}
}
}
return !Brush->RootOutside;
}
works fine.