# Triangle/Box Intersection? UE 5.2+

**URL:** <https://forums.unrealengine.com/t/triangle-box-intersection-ue-5-2/2162966>\
**Category:** Programming & Scripting\
**Tags:** math, unreal-engine, Engine-Source-Code, CPP, question, box-overlap\
**Created:** [December 2, 2024, 12:17am UTC](https://forums.unrealengine.com/t/triangle-box-intersection-ue-5-2/2162966 "2024-12-02T00:17:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sweenus987](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweenus987/32/1198170_2.png) [@Sweenus987](https://forums.unrealengine.com/u/Sweenus987)\
**Post date:** [December 2, 2024, 12:17am UTC](https://forums.unrealengine.com/t/triangle-box-intersection-ue-5-2/2162966/1 "2024-12-02T00:17:26Z")

</div>

Does UE 5.2+ have anything built in for AABB/Triangle intersections?

It has ones for Line/Box, Line/Plane, Line/Sphere etc. but I need to see if a triangle intersects a box and if a box is inside a triangle too.

---

<div class="post-metadata">

**Author:** ![Sweenus987](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sweenus987/32/1198170_2.png) [@Sweenus987](https://forums.unrealengine.com/u/Sweenus987)\
**Post date:** [December 4, 2024, 5:23pm UTC](https://forums.unrealengine.com/t/triangle-box-intersection-ue-5-2/2162966/2 "2024-12-04T17:23:48Z")

</div>

So I couldn’t find any specific built in functionality but I did find a resource where the code seems to work well. I have tried various resources but this is the only one that I’ve managed to get to work completely.

[bzgeb/UnityGpuMeshVoxelizerPart2: Part 2 of a GPU-based Mesh Voxelizer for Unity using Compute Shaders](https://github.com/bzgeb/UnityGpuMeshVoxelizerPart2)

Here’s the relevant code ported into UE5 C++ in a [snippet](https://dev.epicgames.com/community/snippets/1A9X/unreal-engine-triangle-aabb-intersection).

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 3, 2025, 5:24pm UTC](https://forums.unrealengine.com/t/triangle-box-intersection-ue-5-2/2162966/3 "2025-01-03T17:24:21Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
